ladish/src/lash_proxy.hpp

75 lines
2.0 KiB
C++
Raw Normal View History

2008-06-13 02:32:27 +03:00
// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
* Patchage is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* Patchage is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef LASH_PROXY_HPP__89E81B38_627F_41B9_AD08_DB119FB5F34C__INCLUDED
#define LASH_PROXY_HPP__89E81B38_627F_41B9_AD08_DB119FB5F34C__INCLUDED
#include "Patchage.hpp"
struct lash_project_info
{
std::string name;
time_t modification_time;
std::string comment;
};
class session;
2008-06-13 02:32:27 +03:00
class lash_proxy
{
public:
lash_proxy(
Patchage* app,
session * session_ptr);
2008-06-13 02:32:27 +03:00
~lash_proxy();
void get_loaded_projects(std::list<std::string>& projects);
void get_available_projects(std::list<lash_project_info>& projects);
2008-06-16 05:00:13 +03:00
void load_project(const std::string& project_name);
void save_all_projects();
void save_project(const std::string& project_name);
void close_project(const std::string& project_name);
void close_all_projects();
2008-06-13 02:32:27 +03:00
private:
void error_msg(const std::string& msg) const;
void info_msg(const std::string& msg) const;
static
DBusHandlerResult
dbus_message_hook(
DBusConnection * connection,
DBusMessage * message,
void * proxy);
bool
call(
bool response_expected,
const char* iface,
const char* method,
DBusMessage ** reply_ptr_ptr,
int in_type,
...);
2008-06-13 02:32:27 +03:00
Patchage* _app;
bool _server_responding;
session * _session_ptr;
2008-06-13 02:32:27 +03:00
};
#endif // #ifndef LASH_PROXY_HPP__89E81B38_627F_41B9_AD08_DB119FB5F34C__INCLUDED