-1, m->cancellable, sm_CbSend, this);
}
+bool CClientBus::m_ActionSend(CAppContentProvider::EMethodActionType type, const char *args)
+{
+ ASSERT(m);
+
+ if (!m->proxy)
+ return false;
+
+ m->cancellable = g_cancellable_new();
+ if (!m->cancellable) {
+ _ERR("cancellable new failed");
+ return false;
+ }
+
+ GVariant *param;
+ GVariantBuilder *builder;
+
+ builder = g_variant_builder_new(G_VARIANT_TYPE_TUPLE);
+ if (!builder) {
+ _ERR("builder new failed");
+ return false;
+ }
+
+ g_variant_builder_add(builder, "s", m->svcid);
+ g_variant_builder_add(builder, "y", type);
+ g_variant_builder_add(builder, "s", args ? args : "");
+
+ param = g_variant_builder_end(builder);
+
+ g_variant_builder_unref(builder);
+
+ g_dbus_proxy_call(m->proxy, BUS_METHOD_SEND_ACTION,
+ param, G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1, m->cancellable, sm_CbSend, this);
+
+ return true;
+}
+
/**
* Invoked when proxy is ready successfully.
*
BUS_INTERFACE, NULL, sm_CbProxy, this);
}
+
+bool CClientBus::SendAction(CAppContentProvider::EMethodActionType type, const char *args)
+{
+ ASSERT(FlagCreate());
+
+ return m_ActionSend(type, args);
+}
#include <stdbool.h>
#include <cp_config.h>
+#include <app-content-provider.h>
class CTimeout {
void m_OnSend(GObject *sobj, GAsyncResult *res);
void m_Send(void);
+ bool m_ActionSend(CAppContentProvider::EMethodActionType type, const char *args);
protected:
virtual void t_OnTimeout(void);
//! Sends service id to client daemons as creating proxy to bus.
void SendSvcid(void);
+
+ //! Sends Action to client daemons
+ bool SendAction(CAppContentProvider::EMethodActionType type, const char *args);
+
};
-#endif /* __CLIENT_BUS_H__ */
\ No newline at end of file
+#endif /* __CLIENT_BUS_H__ */
delete cbus;
continue;
}
+ it->SetCBus(cbus);
cbus->SendSvcid();
m->client_buslist = eina_list_append(m->client_buslist,
cbus);
#include <app-content.h>
#include "Entity.h"
-
+#include "../../ClientBus.h"
class CEngineDBarItem;
virtual ~CEngineBarItem();
void SetEngine(CEngine *eng);
+ void SetCBus(CClientBus *cbus);
void SetCtntId(int id);
int CtntId(void);
bool RemoveDBar(int ctnt_id);
bool AddHistory(CAppContent::EType type, const char *id);
- bool DelHistory(CAppContent::EType type, const char *id);
+ bool DelHistory(const char *id);
bool DelAllHistory(void);
static CEngineBarItem *Alloc(JsonReader *reader, int idx);
#include <glib.h>
#include <app-content.h>
+#include <app-content-provider.h>
#include <AppCommon.h>
#include "../../engine.h"
+#include "../../ClientBus.h"
#include "../include/EngineBarItem.h"
struct SEngineBarItem {
CEngine *eng;
+ CClientBus *cbus;
int r;
int g;
}
+void CEngineBarItem::SetCBus(CClientBus *cbus)
+{
+ ASSERT(m);
+
+ m->cbus = cbus;
+}
+
+
void CEngineBarItem::SetEngine(CEngine *eng)
{
ASSERT(m);
return false;
}
-bool CEngineBarItem::DelHistory(CAppContent::EType type, const char *id)
+bool CEngineBarItem::DelHistory(const char *id)
{
ASSERT(m);
- return m->eng->DelHistory(type, id);
+ return m->cbus->SendAction(CAppContentProvider::METHOD_ACTION_HISTORY_DEL, id);
}
bool CEngineBarItem::DelAllHistory(void)
{
ASSERT(m);
- return m->eng->DelAllHistory();
+ return m->cbus->SendAction(CAppContentProvider::METHOD_ACTION_HISTORY_DEL_ALL, NULL);
}
bool CEngineBarItem::AddHistory(CAppContent::EType type, const char *id)
svcid = bundle_get_val(args, "svcid");
- if (!m->parent->DelHistory(CAppContent::TYPE_CHANNEL, svcid)) {
+ if (!m->parent->DelHistory(svcid)) {
_ERR("failed to delete history");
bundle_free(args);
return false;
bundle_free(args);
}
else {
- if (!m->parent->DelHistory(CAppContent::TYPE_APPS, Str(VSTR_ACTOR))) {
+ if (!m->parent->DelHistory(Str(VSTR_ACTOR))) {
_ERR("failed to delete history");
return false;
}