libtelepathy/tsrc/inc/telepathygabblesendmessage.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2 * Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Class declaration for SendMessage.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21  
       
    22 #ifndef DBUS_API_SUBJECT_TO_CHANGE
       
    23 #define DBUS_API_SUBJECT_TO_CHANGE
       
    24 #endif
       
    25 
       
    26 
       
    27 //Include files
       
    28 #include <e32err.h>
       
    29 #include <e32const.h>
       
    30 #include <e32base.h>
       
    31 
       
    32 #include <stdio.h>
       
    33 #include <stdlib.h>
       
    34 #include <string.h>
       
    35 #include <signal.h>
       
    36 
       
    37 #include <dbus/dbus-glib.h>
       
    38 #include <glib.h>
       
    39 	   
       
    40 #include <unistd.h>
       
    41 
       
    42 #include "tp-conn.h"
       
    43 #include "tp-connmgr.h"
       
    44 #include "tp-chan.h"
       
    45 #include "tp-chan-gen.h"
       
    46 #include "tp-ch-gen.h"
       
    47 #include "tp-chan-iface-group-gen.h"
       
    48 #include "tp-chan-type-text-gen.h"
       
    49 #include "tp-chan-type-streamed-media-gen.h"
       
    50 #include "tp-props-iface.h"
       
    51 #include "tp-constants.h"
       
    52 #include "tp-interfaces.h"
       
    53 #include <pthread.h>
       
    54 
       
    55 
       
    56 // FORWARD DECLARATION
       
    57 class CTestData;
       
    58 
       
    59 
       
    60 #define VERBOSE
       
    61 
       
    62 
       
    63 // CLASS DECLARATION
       
    64 NONSHARABLE_CLASS(CTelepathyGabbleSendRecvMessage) : public CBase
       
    65     {
       
    66     
       
    67     private:
       
    68     	/**
       
    69         * C++ default constructor.
       
    70         */
       
    71        
       
    72         CTelepathyGabbleSendRecvMessage();
       
    73 
       
    74         /**
       
    75         * By default Symbian 2nd phase constructor is private.
       
    76         */
       
    77         void ConstructL();
       
    78         
       
    79    public:  // Constructors and destructor
       
    80         /**
       
    81         * Two-phased constructor.
       
    82         */
       
    83         static CTelepathyGabbleSendRecvMessage* NewL();
       
    84 
       
    85         /**
       
    86         * Destructor.
       
    87         */
       
    88         ~CTelepathyGabbleSendRecvMessage();
       
    89         
       
    90    
       
    91 		
       
    92     public: // Member functions
       
    93     
       
    94 		  	// Member function to send the message.
       
    95 	     TInt SendMessage( const char *contact_id, const char *message,
       
    96 	     					CTestData* aTestData  );
       
    97 			
       
    98 		 TInt ReceiveMessage(const char *contact_id, const char *message,
       
    99 		 						CTestData* aTestData );
       
   100 		
       
   101 			
       
   102 	public : //Callback functions
       
   103 
       
   104 		 //Callback function for sendmessage
       
   105 		 static void sendmessage_cb( DBusGProxy *proxy, GError *error, gpointer userdata );
       
   106 	
       
   107 	
       
   108 		//Callback for receive message
       
   109 		static void receivedMessage_cb (  DBusGProxy *proxy,guint            message_id,
       
   110 								   	guint            timestamp,guint            from_handle,
       
   111 								   	guint            message_type,guint            message_flags,
       
   112 								    gchar           *message_body,gpointer		user_data );
       
   113 								    
       
   114 								    
       
   115 		static void SendError_cb (  DBusGProxy *proxy,
       
   116 								guint            error,
       
   117 							   	guint            timestamp,
       
   118 							    guint            message_type,
       
   119 							    gchar           *message_body,
       
   120 							    gpointer		user_data )	;							    
       
   121 								    
       
   122 								    
       
   123 		//Callback for the text_channel_find for a particular contact_id.			  
       
   124 		static gboolean text_channels_find_func(gchar *key,TpChan *text_channel, guint *contact_handle);
       
   125 	
       
   126 
       
   127  };
       
   128 
       
   129 
       
   130 
       
   131 
       
   132 
       
   133