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"
|
|
|
|
|
2008-06-18 22:21:24 +03:00
|
|
|
struct lash_project_info
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
time_t modification_time;
|
|
|
|
std::string comment;
|
|
|
|
};
|
|
|
|
|
2008-07-03 22:55:43 +03:00
|
|
|
class session;
|
|
|
|
|
2008-06-13 02:32:27 +03:00
|
|
|
class lash_proxy
|
|
|
|
{
|
|
|
|
public:
|
2008-07-03 22:55:43 +03:00
|
|
|
lash_proxy(
|
|
|
|
Patchage* app,
|
|
|
|
session * session_ptr);
|
2008-06-13 02:32:27 +03:00
|
|
|
~lash_proxy();
|
|
|
|
|
2008-06-15 23:21:31 +03:00
|
|
|
void get_loaded_projects(std::list<std::string>& projects);
|
2008-06-18 22:21:24 +03:00
|
|
|
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);
|
2008-06-15 23:41:41 +03:00
|
|
|
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-15 16:24:12 +03:00
|
|
|
|
2008-06-13 02:32:27 +03:00
|
|
|
private:
|
2008-06-13 03:30:22 +03:00
|
|
|
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);
|
|
|
|
|
2008-06-15 16:24:12 +03:00
|
|
|
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;
|
2008-07-03 22:55:43 +03:00
|
|
|
session * _session_ptr;
|
2008-06-13 02:32:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // #ifndef LASH_PROXY_HPP__89E81B38_627F_41B9_AD08_DB119FB5F34C__INCLUDED
|