00001 // 00002 // Copyright (c) 2009-2009 HIIT and Tero Hasu 00003 // Copyright (c) 2007-2009 Google Inc. 00004 // Copyright (c) 2006-2007 Jaiku Ltd. 00005 // Copyright (c) 2002-2006 Mika Raento and Renaud Petit 00006 // 00007 // This software is licensed at your choice under either 1 or 2 below. 00008 // 00009 // 1. MIT License 00010 // 00011 // Permission is hereby granted, free of charge, to any person obtaining a copy 00012 // of this software and associated documentation files (the "Software"), to deal 00013 // in the Software without restriction, including without limitation the rights 00014 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00015 // copies of the Software, and to permit persons to whom the Software is 00016 // furnished to do so, subject to the following conditions: 00017 // 00018 // The above copyright notice and this permission notice shall be included in 00019 // all copies or substantial portions of the Software. 00020 // 00021 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00022 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00024 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00026 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00027 // THE SOFTWARE. 00028 // 00029 // 2. Gnu General Public license 2.0 00030 // 00031 // This program is free software; you can redistribute it and/or 00032 // modify it under the terms of the GNU General Public License 00033 // as published by the Free Software Foundation; either version 2 00034 // of the License, or (at your option) any later version. 00035 // 00036 // This program is distributed in the hope that it will be useful, 00037 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00038 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00039 // GNU General Public License for more details. 00040 // 00041 // You should have received a copy of the GNU General Public License 00042 // along with this program; if not, write to the Free Software 00043 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00044 // 00045 00046 #ifndef CL_SMS_H_INCLUDED 00047 #define CL_SMS_H_INCLUDED 00048 00049 #include "application_config.h" 00050 00051 #include <mtclbase.h> 00052 #include <msvapi.h> 00053 #include <mtclreg.h> 00054 00055 #include <txtrich.h> 00056 00057 #include <f32file.h> 00058 00059 NONSHARABLE_CLASS(i_handle_received_sms) 00060 { 00061 public: 00062 virtual void handle_reception(const TMsvId& entry_id, const TMsvId& folder_id, 00063 const TDesC& sender, CRichText& body) = 0; 00064 virtual void handle_reception(const TMsvId& entry_id, const TMsvId& folder_id, 00065 TUid aMtmUid, CBaseMtm* aMtm); 00066 00067 virtual void handle_error(TInt aError) = 0; 00068 virtual void handle_close() = 0; 00069 virtual void handle_sending(const TMsvId& entry_id, 00070 const TDesC& sender, CRichText& body) = 0; 00071 virtual void handle_sending(const TMsvId& entry_id, 00072 TUid aMtmUid, CBaseMtm* aMtm); 00073 }; 00074 00075 NONSHARABLE_CLASS(CSmsEventNotifier) : 00076 public CBase, MMsvSessionObserver 00077 { 00078 public: 00079 static CSmsEventNotifier* NewL(); 00080 CSmsEventNotifier(); 00081 ~CSmsEventNotifier(); 00082 void ConstructL(); 00083 void SetHandler(i_handle_received_sms* handler); 00084 00085 protected: // MMsvSessionObserver 00086 virtual void HandleSessionEventL(TMsvSessionEvent aEvent, 00087 TAny* aArg1, TAny* aArg2, TAny* aArg3); 00088 00089 private: 00090 void DoHandleSessionEventL(TMsvSessionEvent aEvent, 00091 TAny* aArg1, TAny* aArg2, TAny* aArg3); 00092 00093 void HandleReceivedL(const TMsvId& entry_id, const TMsvId& folder_id); 00094 void HandleErrorL(TInt aError); 00095 void HandleSentL(const TMsvId& entry_id); 00096 00097 private: 00098 TUid loadmessageL(const TMsvId& entry_id, TMsvEntry& entry); 00099 00100 CMsvSession* iReceiveSession; 00101 CClientMtmRegistry* iReceiveMtmReg; 00102 CBaseMtm *iReceiveMtm, *iMMSMtm; 00103 TBuf<50> state; 00104 00105 i_handle_received_sms* iHandler; 00106 }; 00107 00108 #endif // CL_SMS_H_INCLUDED
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:57 2011 by Doxygen 1.6.1