1 <?xml version="1.0" encoding="iso-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <title>tpsession: tpsession.h Source File</title>
7 <link href="doxygen.css" rel="stylesheet" type="text/css" />
10 <table border="0" cellpadding="0" cellspacing="0" width="100%">
12 <td width="1"> </td>
13 <td class="postheader" valign="center">
15 <font color="#004faf">Home</font></a> ·
16 <a href="classes.html">
17 <font color="#004faf">All Classes</font></a> ·
18 <a href="namespaces.html">
19 <font color="#004faf">All Namespaces</font></a> ·
20 <a href="modules.html">
21 <font color="#004faf">Modules</font></a> ·
22 <a href="functions.html">
23 <font color="#004faf">Functions</font></a> ·
25 <font color="#004faf">Files</font></a>
31 <!-- Generated by Doxygen 1.5.6 -->
32 <h1>tpsession.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
33 <a name="l00002"></a>00002 <span class="comment"> * This file is part of TpSession</span>
34 <a name="l00003"></a>00003 <span class="comment"> *</span>
35 <a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).</span>
36 <a name="l00005"></a>00005 <span class="comment"> * Contact Kate Alhola kate.alholanokia.com</span>
37 <a name="l00006"></a>00006 <span class="comment"> *</span>
38 <a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
39 <a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
40 <a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span>
41 <a name="l00010"></a>00010 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
42 <a name="l00011"></a>00011 <span class="comment"> *</span>
43 <a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
44 <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
45 <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
46 <a name="l00015"></a>00015 <span class="comment"> * Lesser General Public License for more details.</span>
47 <a name="l00016"></a>00016 <span class="comment"> *</span>
48 <a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
49 <a name="l00018"></a>00018 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
50 <a name="l00019"></a>00019 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</span>
51 <a name="l00020"></a>00020 <span class="comment"> */</span>
52 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef TPSESSION_H</span>
53 <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define TPSESSION_H</span>
54 <a name="l00023"></a>00023 <span class="preprocessor"></span>
55 <a name="l00024"></a>00024 <span class="preprocessor">#include <TelepathyQt4/Types></span>
56 <a name="l00025"></a>00025 <span class="preprocessor">#include <TelepathyQt4/Account></span>
57 <a name="l00026"></a>00026 <span class="preprocessor">#include <TelepathyQt4/Types></span>
58 <a name="l00027"></a>00027 <span class="preprocessor">#include <TelepathyQt4/PendingChannelRequest></span>
59 <a name="l00028"></a>00028 <span class="preprocessor">#include <TelepathyQt4/ChannelRequest></span>
60 <a name="l00029"></a>00029 <span class="preprocessor">#include <TelepathyQt4/PendingChannel></span>
61 <a name="l00030"></a>00030 <span class="preprocessor">#include <TelepathyQt4/Channel></span>
62 <a name="l00031"></a>00031 <span class="preprocessor">#include <TelepathyQt4/TextChannel></span>
63 <a name="l00032"></a>00032 <span class="preprocessor">#include <TelepathyQt4/AccountManager></span>
64 <a name="l00033"></a>00033 <span class="preprocessor">#include <TelepathyQt4/PendingOperation></span>
65 <a name="l00034"></a>00034 <span class="preprocessor">#include <TelepathyQt4/PendingReady></span>
66 <a name="l00035"></a>00035 <span class="preprocessor">#include <TelepathyQt4/ClientRegistrar></span>
67 <a name="l00036"></a>00036 <span class="preprocessor">#include <TelepathyQt4/Debug></span>
68 <a name="l00037"></a>00037
69 <a name="l00038"></a>00038 <span class="preprocessor">#include <QString></span>
70 <a name="l00039"></a>00039 <span class="preprocessor">#include <QVector></span>
71 <a name="l00040"></a>00040 <span class="preprocessor">#include <QObject></span>
72 <a name="l00041"></a>00041
73 <a name="l00042"></a>00042 <span class="preprocessor">#include "tpsessionaccount.h"</span>
74 <a name="l00043"></a>00043 <span class="preprocessor">#include "tpsessionobserver.h"</span>
75 <a name="l00044"></a>00044
76 <a name="l00045"></a><a class="code" href="classTpSession.html">00045</a> <span class="keyword">class </span><a class="code" href="classTpSession.html">TpSession</a>:<span class="keyword">public</span> QObject
77 <a name="l00046"></a>00046 {
78 <a name="l00047"></a>00047 Q_OBJECT
79 <a name="l00048"></a>00048 <span class="keyword">public</span>:
80 <a name="l00049"></a>00049 <a class="code" href="classTpSession.html#044a254379e9c218db0a94923b6541e2">TpSession</a>(QString cmname=QString(),<span class="keywordtype">bool</span> synchronous=FALSE);
81 <a name="l00050"></a>00050
82 <a name="l00051"></a>00051
83 <a name="l00052"></a>00052 <span class="keyword">static</span> <a class="code" href="classTpSession.html">TpSession</a>* <a class="code" href="classTpSession.html#a3cb4db71a56f67e75d80a087e8c4805">instance</a>(<span class="keywordtype">bool</span> synchronous=TRUE);
84 <a name="l00053"></a>00053 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#d4631fd1a7c35a4b964df6e7ba9286b5">sendMessageToAddress</a>(QString connectionMgr,QString address,QString message);
85 <a name="l00054"></a>00054 <a class="code" href="classTpSessionAccount.html">TpSessionAccount</a>* <a class="code" href="classTpSession.html#eb1e40ae48a4b3e833a62c08a0a843b1">getAccount</a>(<span class="keyword">const</span> QString cm, <span class="keyword">const</span> QString protocol=QString());
86 <a name="l00055"></a>00055 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#6128c07874af5745ce5313b01c7ab5a8">createChannelListener</a>(<span class="keyword">const</span> QString &channelType,
87 <a name="l00056"></a>00056 <span class="keyword">const</span> Tp::MethodInvocationContextPtr<> &context,
88 <a name="l00057"></a>00057 <span class="keyword">const</span> Tp::AccountPtr &account,
89 <a name="l00058"></a>00058 <span class="keyword">const</span> Tp::ChannelPtr &channel);
90 <a name="l00059"></a>00059 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#4aceacc0eb867cd8624ae647a571fdf6">createObserver</a>();
91 <a name="l00060"></a>00060
92 <a name="l00061"></a>00061 signals:
93 <a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#d347e57e90a38ba88de384b0e12d29d9">amReady</a>(<a class="code" href="classTpSession.html">TpSession</a> *);
94 <a name="l00063"></a>00063 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#73355b0eefdb9ddf9256cf5564a15384">accountReady</a>(<a class="code" href="classTpSessionAccount.html">TpSessionAccount</a> *);
95 <a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#c748175fc27394bebad29dca135ae9b4">channeReady</a>(<a class="code" href="classTpSessionAccount.html">TpSessionAccount</a> *);
96 <a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="classTpSession.html#4140850eed688948df8e86b760ca3ffd">messageReceived</a>(<span class="keyword">const</span> Tp::ReceivedMessage &,<a class="code" href="classTpSessionAccount.html">TpSessionAccount</a> *);
97 <a name="l00066"></a>00066 <span class="keyword">private</span> slots:
98 <a name="l00067"></a>00067 <span class="keywordtype">void</span> onAMReady(Tp::PendingOperation *);
99 <a name="l00068"></a>00068 <span class="keywordtype">void</span> onAccountCreated(<span class="keyword">const</span> QString &);
100 <a name="l00069"></a>00069 <span class="keywordtype">void</span> onReady(Tp::PendingOperation *);
101 <a name="l00070"></a>00070 <span class="keywordtype">void</span> onAccountReady(<a class="code" href="classTpSessionAccount.html">TpSessionAccount</a> *tpacc);
102 <a name="l00071"></a>00071 <span class="keywordtype">void</span> onMessageReceived(<span class="keyword">const</span> Tp::ReceivedMessage &,<a class="code" href="classTpSessionAccount.html">TpSessionAccount</a> *);
103 <a name="l00072"></a>00072 <span class="keyword">public</span>:
104 <a name="l00073"></a><a class="code" href="classTpSession.html#f592fe9efb0b7072dc5166a83f11c56c">00073</a> QVector<TpSessionAccount*> <a class="code" href="classTpSession.html#f592fe9efb0b7072dc5166a83f11c56c">accounts</a>;
105 <a name="l00074"></a>00074
106 <a name="l00075"></a>00075 <span class="keyword">private</span>:
107 <a name="l00076"></a>00076 <span class="keyword">static</span> <a class="code" href="classTpSession.html">TpSession</a> *instancePtr;
108 <a name="l00077"></a>00077 <span class="comment">//TpSession *instancePtr;</span>
109 <a name="l00078"></a>00078 QString reqCm;
110 <a name="l00079"></a>00079 QString reqAddress;
111 <a name="l00080"></a>00080 QString reqMsg;
112 <a name="l00081"></a>00081
113 <a name="l00082"></a>00082 <span class="keywordtype">bool</span> sync; <span class="comment">// Synchronous initialization</span>
114 <a name="l00083"></a>00083 QEventLoop loop;
115 <a name="l00084"></a>00084 Tp::AccountManagerPtr mAM;
116 <a name="l00085"></a>00085 QStringList channels;
117 <a name="l00086"></a>00086 Tp::ClientRegistrarPtr registrar;
118 <a name="l00087"></a>00087 };
119 <a name="l00088"></a>00088
120 <a name="l00089"></a>00089
121 <a name="l00090"></a>00090
122 <a name="l00091"></a>00091 <span class="preprocessor">#endif // TPSESSION_H</span>
124 <p /><address><hr /><div align="center">
125 <table width="100%" cellspacing="0" border="0"><tr class="address">
126 <td width="30%">Copyright © 2010 Nokia Corporation</td>
127 <td width="30%" align="right"><div align="right">TpSession </div></td>
128 </tr></table></div></address>