|
1 /* |
|
2 * Copyright (c) 2004-2007 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 "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: mmsmessagestoreutils declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __MMSMESSAGESTOREUTILS_H |
|
21 #define __MMSMESSAGESTOREUTILS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <msvstd.h> |
|
26 #include <msvapi.h> |
|
27 |
|
28 // USERINCLUDE FILES |
|
29 #include "mmsconst.h" |
|
30 |
|
31 // CONSTANTS |
|
32 // Folder for local mode |
|
33 _LIT( KMmsDefaultServiceName, "MMSService" ); |
|
34 |
|
35 // MACROS |
|
36 // DATA TYPES |
|
37 // FUNCTION PROTOTYPES |
|
38 // FORWARD DECLARATIONS |
|
39 |
|
40 // CLASS DECLARATION |
|
41 /** |
|
42 * CMmsMessageStoreUtils is a helper class for CMmsSettings class. |
|
43 * This class does not access CenRep, but instead it encapsulates communication |
|
44 * with MessageStore. |
|
45 * @lib mmsserversettings.lib |
|
46 * @since 3.0 |
|
47 */ |
|
48 class CMmsMessageStoreUtils : public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 IMPORT_C static CMmsMessageStoreUtils* NewL( CMsvSession& aSession ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CMmsMessageStoreUtils(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * CreateServiceEntryL deletes all found old MMS service entries |
|
66 * directly under root, and then creates a new one. |
|
67 * @return entry id of the new service |
|
68 */ |
|
69 TMsvId CreateServiceEntryL(); |
|
70 |
|
71 /** |
|
72 * CreateFolderEntryL deletes all found old folder entries directly |
|
73 * under local service with 'aFolderName' name, and then creates a new |
|
74 * one. |
|
75 * @param name of folder entry |
|
76 * @return entry id of the new folder |
|
77 */ |
|
78 TMsvId CreateFolderEntryL( const TDesC& aFolderName ); |
|
79 |
|
80 /** |
|
81 * CreateFolderEntryL creates a new folder entry under a given folder |
|
82 * with 'aFolderName' name. |
|
83 * @param aParentFolder a folder, under which the new folder is created. |
|
84 * @param aFolderName name of folder entry |
|
85 * @param aFolderId entry id of the new folder or |
|
86 * if the folder already exists, the folder id of the existing folder |
|
87 * @return KErrNone if successful. |
|
88 * KErrAlreadyExists, if a folder with same name exists under aParentFoder |
|
89 */ |
|
90 TInt CreateFolderEntryL( TMsvId aParentFolder, const TDesC& aFolderName, TMsvId& aFolderId ); |
|
91 |
|
92 /** |
|
93 * Gets a folder entry id of the given aFolderName |
|
94 * |
|
95 * @param aParentFolder a folder, under where the folder is searched |
|
96 * @param aFolderName name of folder entry |
|
97 * @return entry id of the folder |
|
98 */ |
|
99 TMsvId FolderEntryL( TMsvId aParentFolder, const TDesC& aFolderName ); |
|
100 |
|
101 |
|
102 protected: // New functions |
|
103 |
|
104 protected: // Functions from base classes |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * Cobstructor |
|
110 */ |
|
111 void ConstructL( CMsvSession& aSession ); |
|
112 |
|
113 /** |
|
114 * C++ default constructor. |
|
115 */ |
|
116 CMmsMessageStoreUtils(); |
|
117 |
|
118 public: // Data |
|
119 |
|
120 protected: // Data |
|
121 |
|
122 private: // Data |
|
123 |
|
124 CMsvSession* iSession; |
|
125 CMsvEntry* iParentEntry; |
|
126 CMsvEntry* iMmsEntry; |
|
127 }; |
|
128 |
|
129 #endif // __MMSMESSAGESTOREUTILS_H |
|
130 |
|
131 // End of File |