libtelepathy/tsrc/inc/telepathygabblelogintest.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 Login Test Cases.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef DBUS_API_SUBJECT_TO_CHANGE
       
    24 #define DBUS_API_SUBJECT_TO_CHANGE
       
    25 #endif
       
    26 
       
    27 #include <stdio.h>
       
    28 #include <stdlib.h>
       
    29 #include <string.h>
       
    30 #include <signal.h>
       
    31 
       
    32 #include <dbus/dbus-glib.h>
       
    33 #include <glib.h>
       
    34 
       
    35 #include <unistd.h>
       
    36 
       
    37 #include "tp-conn.h"
       
    38 #include "tp-connmgr.h"
       
    39 #include "tp-chan.h"
       
    40 #include "tp-chan-gen.h"
       
    41 #include "tp-ch-gen.h"
       
    42 #include "tp-chan-iface-group-gen.h"
       
    43 #include "tp-chan-type-text-gen.h"
       
    44 #include "tp-chan-type-streamed-media-gen.h"
       
    45 #include "tp-props-iface.h"
       
    46 #include "tp-constants.h"
       
    47 #include "tp-interfaces.h"
       
    48 
       
    49 #include <pthread.h>
       
    50 
       
    51 #define VERBOSE
       
    52 
       
    53 #include "telepathygabbletestdata.h"
       
    54 
       
    55 
       
    56 #define CONNMGR_NAME "telepathy-gabble"
       
    57 #define CONNMGR_BUS "org.freedesktop.Telepathy.ConnectionManager.gabble"
       
    58 #define CONNMGR_PATH "/org/freedesktop/Telepathy/ConnectionManager/gabble"
       
    59 #define CHANNEL_BUS "org.freedesktop.Telepathy.Channel.Type.Text"
       
    60 #define CHANNEL_PATH "/org/freedesktop/Telepathy/Channel/Type/Text"
       
    61 #define PROTOCOL "jabber"
       
    62 
       
    63 
       
    64 
       
    65 //forward decalration
       
    66 class CTestData;
       
    67 
       
    68 //class declaration			
       
    69 NONSHARABLE_CLASS(CTelepathyGabbleLoginTest) : public CBase
       
    70     {
       
    71    
       
    72     private:
       
    73     	/**
       
    74         * C++ default constructor.
       
    75         */
       
    76        
       
    77         CTelepathyGabbleLoginTest();
       
    78 
       
    79         /**
       
    80         * By default Symbian 2nd phase constructor is private.
       
    81         */
       
    82         void ConstructL();
       
    83         
       
    84    public:  // Constructors and destructor
       
    85         /**
       
    86         * Two-phased constructor.
       
    87         */
       
    88         static CTelepathyGabbleLoginTest* NewL();
       
    89 
       
    90         /**
       
    91         * Destructor.
       
    92         */
       
    93         ~CTelepathyGabbleLoginTest();
       
    94         
       
    95    
       
    96 		
       
    97     public: // Member functions
       
    98 
       
    99 	   //Login and Logout functions
       
   100        TInt action_login(char* username,char* password,
       
   101        							char* server,char* resource,char* ssl_flag,
       
   102        							char *port,char *proxy_server, char *proxy_port,
       
   103        							CTestData* aTestData);
       
   104 
       
   105 	   TInt action_logout( CTestData* aTestData );
       
   106 	   
       
   107 	   TInt action_cancel(char* username,char* password,
       
   108 	   							char* server, char* resource,char* ssl_flag,
       
   109 	   							char *port,char *proxy_server, char *proxy_port,
       
   110 	   							CTestData* aTestData );
       
   111 	 
       
   112 	   
       
   113 	public : //Callback functions
       
   114 	   //Callback function for the status change
       
   115 
       
   116 		static gboolean status_changed_cb(DBusGProxy *proxy,
       
   117 		  guint status, guint reason,
       
   118 		  gpointer user_data);
       
   119 
       
   120 		//Callback for the creation of a new channel on succeccful login.				  
       
   121 		static void new_channel_handler(DBusGProxy *proxy, const char *object_path,
       
   122 			const char *channel_type, guint handle_type,
       
   123 			guint channel_handle, gboolean suppress_handler,
       
   124 			gpointer user_data);
       
   125 		
       
   126 	
       
   127 		//Init the text_channel	
       
   128 		static void text_channel_init  ( TpChan   *text_chan  );
       
   129 		
       
   130 	
       
   131 	 };
       
   132