rk_remokon.h

Go to the documentation of this file.
00001 #ifndef __rk_remokon_h__
00002 #define __rk_remokon_h__
00003 
00004 #include "application_config.h"
00005 
00006 #include "ac_app_context.h"
00007 
00008 #include <glib.h>
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013 
00014   typedef struct _rk_Remokon rk_Remokon;
00015   
00016   rk_Remokon* rk_Remokon_new(GError** error);
00017 
00018   void rk_Remokon_destroy(rk_Remokon* self);
00019 
00020   // Attempts to establish a connection to the server, and keeps
00021   // attempting. Does nothing if already started.
00022   gboolean rk_Remokon_start(rk_Remokon* self,
00023           GError** error);
00024   
00025   // Breaks any existing connection. Does nothing if already stopped.
00026   void rk_Remokon_stop(rk_Remokon* self);
00027 
00028   // Runs remokon for the specified amount of time, and after that
00029   // stops it. The timer is reset whenever there are actual requests
00030   // coming in.
00031   gboolean rk_Remokon_start_timed(rk_Remokon* self,
00032           int secs,
00033           GError** error);
00034 
00035   // Modifies the runtime configuration. Any existing connection is
00036   // not broken. (Use this for instance when the IAP parameter changes.)
00037   gboolean rk_Remokon_reconfigure(rk_Remokon* object,
00038           const gchar* key,
00039           const gchar* value,
00040           GError** error);
00041 
00042   // We might implement the following for local control purposes, but
00043   // they of course will not be useful for remote queries.
00044   
00045   gboolean rk_Remokon_is_started(rk_Remokon* self);
00046   
00047   gboolean rk_Remokon_is_autostart_enabled(rk_Remokon* self);
00048   
00049   // If connected with an established session, ready for messaging.
00050   gboolean rk_Remokon_is_connected(rk_Remokon* self);
00051 
00052   // Sends a CL2 initiated message. Normally messaging is done
00053   // internally within Remokon, driven by externally originating
00054   // messages, but Jabber messages might serve as a useful event
00055   // notification mechanism, say triggered by a database modification.
00056   gboolean rk_Remokon_send(rk_Remokon* self,
00057          const char* toJid,
00058          const char* msgText,
00059          GError** error);
00060 
00061   rk_Remokon* ac_get_Remokon(ac_AppContext* self);
00062 #define ac_global_Remokon ac_get_Remokon(ac_get_global_AppContext())
00063 
00064 #ifdef __cplusplus
00065 } /* extern "C" */
00066 #endif
00067 
00068 #endif /* __rk_remokon_h__ */
00069 
00070 /**
00071 
00072 rk_remokon.h
00073 
00074 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00075 and the authors. All rights reserved.
00076 
00077 Authors: Tero Hasu <tero.hasu@hut.fi>
00078 
00079 Permission is hereby granted, free of charge, to any person
00080 obtaining a copy of this software and associated documentation files
00081 (the "Software"), to deal in the Software without restriction,
00082 including without limitation the rights to use, copy, modify, merge,
00083 publish, distribute, sublicense, and/or sell copies of the Software,
00084 and to permit persons to whom the Software is furnished to do so,
00085 subject to the following conditions:
00086 
00087 The above copyright notice and this permission notice shall be
00088 included in all copies or substantial portions of the Software.
00089 
00090 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00091 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00092 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00093 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00094 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00095 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00096 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00097 SOFTWARE.
00098 
00099  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:56 2011 by Doxygen 1.6.1