epoc32/include/app/cacheman.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
       
    14 // CACHEMAN.H
    14 //
    15 //
    15 
    16 /**
       
    17  * @file 
       
    18  * @publishedAll
       
    19  * @released
       
    20  */
    16 #if !defined (__CACHEMAN_H__)
    21 #if !defined (__CACHEMAN_H__)
    17 #define __CACHEMAN_H__
    22 #define __CACHEMAN_H__
    18 
    23 
    19 #include <mentact.h>
    24 #include <mentact.h>
    20 #include <msvstd.h>
    25 #include <msvstd.h>
    21 #include <msvapi.h>
    26 #include <msvapi.h>
       
    27 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS  
       
    28 #include <cimprunemessage.h>
       
    29 #include "cimfinder.h"
       
    30 #endif
    22 
    31 
    23 _LIT(KMiutWildCard, "*.*");
    32 class CImMessageFinder;
    24 
    33 class CImMessageCounter;
    25 class CImFinder : public CMsgActive
       
    26 /**
       
    27 @internalComponent
       
    28 @released
       
    29 */
       
    30 	{
       
    31 public:
       
    32 	IMPORT_C void FindFirstL(TMsvId aRootEntry, TRequestStatus &aStatus);
       
    33 	IMPORT_C ~CImFinder();
       
    34 	IMPORT_C virtual void FindNextL(TRequestStatus &aStatus);
       
    35 	void FindFirstL(const CMsvEntrySelection& aInitialSelection, TRequestStatus &aStatus);
       
    36 
       
    37 	class CImEntryStack : public CBase
       
    38 		{
       
    39 	public:
       
    40 		static CImEntryStack* NewL();
       
    41 		~CImEntryStack();
       
    42 		inline void PushL(TMsvId aId);
       
    43 		inline TMsvId PopL();
       
    44 		inline TBool Empty() const;
       
    45 		inline void Reset();
       
    46 
       
    47 	private:
       
    48 		void ConstructL();
       
    49 
       
    50 		CMsvEntrySelection* iFolders;
       
    51 		};
       
    52 
       
    53 protected:
       
    54 	void ConstructL();
       
    55 	CImFinder(CMsvEntry& aEntry);
       
    56 
       
    57 private:
       
    58 	void DoRunL();
       
    59 
       
    60 	virtual void AddChildEntriesL() = 0;
       
    61 	virtual TBool IsRequiredEntryType(TUid aEntryType) const = 0;
       
    62 
       
    63 protected:
       
    64 	CImEntryStack* iEntryStack;
       
    65 	CMsvEntry& iCurrentEntry;
       
    66 
       
    67 private:
       
    68 	enum TImmfState
       
    69 		{
       
    70 		EImmfEntryFound,
       
    71 		EImmfFindingEntry,
       
    72 		EImmfNothingFound
       
    73 		};
       
    74 
       
    75 	TImmfState iState;
       
    76 	};
       
    77 
       
    78 
       
    79 class CImMessageFinder : public CImFinder
       
    80 /**
       
    81 @internalComponent
       
    82 @released
       
    83 */
       
    84 	{
       
    85 public:
       
    86 	IMPORT_C static CImMessageFinder* NewL(CMsvEntry& aEntry);
       
    87 	IMPORT_C static CImMessageFinder* NewLC(CMsvEntry& aEntry);
       
    88 	
       
    89 protected:
       
    90 	virtual void AddChildEntriesL();
       
    91 	virtual TBool IsRequiredEntryType(TUid aEntryType) const;
       
    92 
       
    93 	CImMessageFinder(CMsvEntry& aEntry);
       
    94 	};
       
    95 
       
    96 
       
    97 class CImEntryFinder : public CImFinder
       
    98 /**
       
    99 @internalComponent
       
   100 @released
       
   101 */
       
   102 	{
       
   103 public:
       
   104 	IMPORT_C static CImEntryFinder* NewL(CMsvEntry& aEntry);
       
   105 	IMPORT_C static CImEntryFinder* NewLC(CMsvEntry& aEntry);
       
   106 	
       
   107 protected:
       
   108 	virtual void AddChildEntriesL();
       
   109 	virtual TBool IsRequiredEntryType(TUid aEntryType) const;
       
   110 
       
   111 	CImEntryFinder(CMsvEntry& aEntry);
       
   112 	};
       
   113 
       
   114 
       
   115 class CImMessageCounter : public CImFinder
       
   116 /**
       
   117 @internalComponent
       
   118 @released
       
   119 */
       
   120 	{
       
   121 public:
       
   122 	IMPORT_C static CImMessageCounter* NewL(CMsvEntry& aEntry);
       
   123 	IMPORT_C static CImMessageCounter* NewLC(CMsvEntry& aEntry);
       
   124 	IMPORT_C TInt Count();
       
   125 	
       
   126 protected:
       
   127 	virtual void AddChildEntriesL();
       
   128 	virtual TBool IsRequiredEntryType(TUid aEntryType) const;
       
   129 
       
   130 	CImMessageCounter(CMsvEntry& aEntry);
       
   131 
       
   132 private:
       
   133 	TInt iCount;
       
   134 	};
       
   135 
       
   136 
       
   137 class CImPruneMessage : public CMsgActive
       
   138 /** Deletes the body text and attachment data from an individually specified message. 
       
   139 
       
   140 Example uses of this class are:
       
   141 
       
   142 1. to cleanup after a populating operation has failed
       
   143 
       
   144 2. to remove body text and attachment data from remote messages, while preserving 
       
   145 the message structure 
       
   146 @publishedPartner 
       
   147 @released
       
   148 */
       
   149 	{
       
   150 public:
       
   151 	IMPORT_C static CImPruneMessage* NewL(CMsvEntry& aEntry, RFs& aFs);
       
   152 	IMPORT_C static CImPruneMessage* NewLC(CMsvEntry& aEntry, RFs& aFs);
       
   153 
       
   154 	IMPORT_C void StartL(TMsvId aMessageEntry, TRequestStatus &aStatus);
       
   155 	~CImPruneMessage();
       
   156 	
       
   157 private:
       
   158 	CImPruneMessage(CMsvEntry& aEntry, RFs& aFs);
       
   159 	void ConstructL();
       
   160 	void DoRunL();
       
   161 	void DoComplete(TInt& );
       
   162 	void DoCancel();
       
   163 	void PruneEntryL();
       
   164 	void ResetStoreL();
       
   165 
       
   166 private:
       
   167 	enum TImPruningState
       
   168 		{
       
   169 		EImPruneUpdatingEntry,
       
   170 		EImPruneUpdatingFirstEntry,
       
   171 		EImPruneFindingEntry,
       
   172 		EImPruneFindFirstEntry,
       
   173 		EImPruneFindNextEntry
       
   174 		};
       
   175 
       
   176 	TImPruningState iState;
       
   177 
       
   178 	CMsvEntry& iCurrentEntry;
       
   179 	RFs& iFs;
       
   180 	CImEntryFinder* iEntryFinder;
       
   181 	CFileMan* iFileManager;
       
   182 	TMsvId iRootEntryId;
       
   183 	CMsvOperation* iChangeOperation;
       
   184 	CMsvStore* iStore;
       
   185 	};
       
   186 
    34 
   187 struct TImCacheManagerProgress
    35 struct TImCacheManagerProgress
   188 /** Holds progress of a cache management cleanup operation.
    36 /** Holds progress of a cache management cleanup operation.
   189 
    37 
   190 @see CImCacheManager::ProgressL() 
    38 @see CImCacheManager::ProgressL()