messagingfw/msgsrvnstore/server/inc/MSVLOPS.H
changeset 0 8e480a14352b
child 34 b66b8f3a7fd8
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__MSVLOPS_H__)
       
    17 #define __MSVLOPS_H__
       
    18 
       
    19 #if !defined(__E32BASE_H__)
       
    20 #include <e32base.h>
       
    21 #endif
       
    22 
       
    23 #if !defined(__MSVOP_H__)
       
    24 #include "msvop.h"
       
    25 #endif
       
    26 
       
    27 
       
    28 class CMsvCopy;
       
    29 class CMsvDelete;
       
    30 class CMsvMove;
       
    31 
       
    32 //**********************************
       
    33 // CMsvLocalOperation
       
    34 //**********************************
       
    35 //
       
    36 // Base class for all local operations
       
    37 //
       
    38 
       
    39 class CMsvLocalOperation : public CMsvServerOperation
       
    40 /**
       
    41 @internalComponent
       
    42 @released
       
    43 */
       
    44 	{
       
    45 public:
       
    46 	CMsvLocalOperation(const RMessage2& aMessage, TMsvOp aId, CMsvServer& aMsvServer);
       
    47 	//
       
    48 	const TDesC8& Progress();
       
    49 	//
       
    50 	TInt SystemProgress(TMsvSystemProgress& aSysProgress);
       
    51 protected:
       
    52 	CMsvServer& iMsvServer;
       
    53 	TPckgBuf<TMsvLocalOperationProgress> iProgress;
       
    54 	};
       
    55 
       
    56 
       
    57 
       
    58 //**********************************
       
    59 // CMsvLocalCopyOperation
       
    60 //**********************************
       
    61 //
       
    62 // Operation used to control server side local copy
       
    63 //
       
    64 
       
    65 class CMsvLocalCopyOperation : public CMsvLocalOperation
       
    66 /**
       
    67 @internalComponent
       
    68 @released
       
    69 */
       
    70 	{
       
    71 public:
       
    72 	CMsvLocalCopyOperation(const RMessage2& aMessage, TMsvOp aId, CMsvEntrySelection* aSelection, TMsvId aTarget, CMsvServer& aMsvServer);
       
    73 	~CMsvLocalCopyOperation();
       
    74 	//
       
    75 	void StartL();
       
    76 	//
       
    77 private:
       
    78 	TInt CopyNextEntry();
       
    79 	void Completed();
       
    80 	// from CActive
       
    81 	void DoCancel();
       
    82 	void RunL();
       
    83 	//
       
    84 private:
       
    85 	CMsvCopy* iCopy;
       
    86 	CMsvEntrySelection* iOrigEntries;
       
    87 	CMsvEntrySelection* iNewEntries;
       
    88 	TInt iIndex;
       
    89 	TMsvId iTarget;
       
    90 	TBool iDescendentCopying;
       
    91 	TMsvId iDescendentId;
       
    92 	};
       
    93 
       
    94 
       
    95 //**********************************
       
    96 // CMsvLocalMoveOperation
       
    97 //**********************************
       
    98 //
       
    99 // Operation used to control server side local move
       
   100 //
       
   101 
       
   102 class CMsvLocalMoveOperation : public CMsvLocalOperation
       
   103 /**
       
   104 @internalComponent
       
   105 @released
       
   106 */
       
   107 	{
       
   108 public:
       
   109 	CMsvLocalMoveOperation(const RMessage2& aMessage, TMsvOp aId, CMsvEntrySelection* aSelection, TMsvId aTarget, CMsvServer& aMsvServer);
       
   110 	~CMsvLocalMoveOperation();
       
   111 	//
       
   112 	void StartL();
       
   113 	//
       
   114 private:
       
   115 	void DoCancel();
       
   116 	void RunL();
       
   117 	void Completed();
       
   118 	TInt MoveNextEntry();
       
   119 	void StartFailed(TInt aError);
       
   120 	//
       
   121 private:
       
   122 	TMsvId iTarget;
       
   123 	TMsvId iParent;
       
   124 	CMsvEntrySelection* iOrigEntries;
       
   125 	CMsvMove* iMove;
       
   126 	TMsvId iNextEntry;
       
   127 	};
       
   128 
       
   129 
       
   130 //**********************************
       
   131 // CMsvLocalDeleteOperation
       
   132 //**********************************
       
   133 //
       
   134 // Operation used to control server side local delete
       
   135 //
       
   136 
       
   137 class CMsvLocalDeleteOperation : public CMsvLocalOperation
       
   138 /**
       
   139 @internalComponent
       
   140 @released
       
   141 */
       
   142 	{
       
   143 public:
       
   144 	CMsvLocalDeleteOperation(const RMessage2& aMessage, TMsvOp aId, CMsvEntrySelection* aSelection, CMsvServer& aMsvServer);
       
   145 	~CMsvLocalDeleteOperation();
       
   146 	//
       
   147 	void StartL();
       
   148 	//
       
   149 private:
       
   150 	void DoCancel();
       
   151 	void RunL();
       
   152 	void Completed();
       
   153 	void DoRunL();
       
   154 	void PartialCompletionNotificationL();
       
   155 	//
       
   156 private:
       
   157 	CMsvEntrySelection* iSelection;
       
   158 	CMsvEntrySelection* iMovedEntries;
       
   159 	CMsvEntrySelection* iDeletedEntries;
       
   160 	CMsvEntrySelection* iWorkSelection1;
       
   161 	CMsvEntrySelection* iWorkSelection2;
       
   162 	CMsvDelete* iDelete;
       
   163 	TMsvId iParent;
       
   164 	TInt iIndex;
       
   165 	};
       
   166 
       
   167 
       
   168 //**********************************
       
   169 // CMsvLocalChangeOperation
       
   170 //**********************************
       
   171 //
       
   172 // Operation used to control server side local change
       
   173 //
       
   174 
       
   175 class CMsvLocalChangeOperation : public CMsvLocalOperation
       
   176 /**
       
   177 @internalComponent
       
   178 @released
       
   179 */
       
   180 	{
       
   181 public:
       
   182 	CMsvLocalChangeOperation(const RMessage2& aMessage, TMsvOp aId, const TMsvEntry& aEntry, CMsvServer& aMsvServer);
       
   183 	~CMsvLocalChangeOperation();
       
   184 	//
       
   185 	void StartL(TSecureId aOwnerId, TBool aForcedUpdate);
       
   186 	//
       
   187 private:
       
   188 	void DoCancel();
       
   189 	void RunL();
       
   190 	void Completed();
       
   191 	//
       
   192 private:
       
   193 	const TMsvEntry& iEntry;
       
   194 	CMsvEntrySelection* iWorkSelection1;
       
   195 	CMsvEntrySelection* iWorkSelection2;
       
   196 	CMsvDelete* iDelete;
       
   197 	TMsvId iId;
       
   198 	TMsvId iParent;
       
   199 	};
       
   200 
       
   201 //**********************************
       
   202 // CMsvLocalCreateOperation
       
   203 //**********************************
       
   204 //
       
   205 // Operation used to control server side local create
       
   206 //
       
   207 
       
   208 class CMsvLocalCreateOperation : public CMsvLocalOperation
       
   209 /**
       
   210 @internalComponent
       
   211 @released
       
   212 */
       
   213 	{
       
   214 public:
       
   215 	CMsvLocalCreateOperation(const RMessage2& aMessage, TMsvOp aId, const TMsvEntry& aEntry, CMsvServer& aMsvServer);
       
   216 	~CMsvLocalCreateOperation();
       
   217 	//
       
   218 	void Start(TSecureId aOwnerId);
       
   219 	//
       
   220 protected:
       
   221 	void DoCancel();
       
   222 	void RunL();
       
   223 	//
       
   224 private:
       
   225 	const TMsvEntry& iEntry;
       
   226 	};
       
   227 
       
   228 //**********************************
       
   229 // CMsvChangeDriveOperation
       
   230 //**********************************
       
   231 class CMsvChangeDriveOperation : public CMsvServerOperation
       
   232 /**
       
   233 @internalComponent
       
   234 @released
       
   235 */
       
   236 	{
       
   237 public:
       
   238 	CMsvChangeDriveOperation(const RMessage2& aMessage, TMsvOp aId, TInt aDrive, CMsvServer& aServer);
       
   239 	~CMsvChangeDriveOperation();
       
   240 	//
       
   241 	const TDesC8& Progress();
       
   242 	TInt Start();
       
   243 	//
       
   244 private:
       
   245 	void DoCancel();
       
   246 	void RunL();
       
   247 	void Completed();
       
   248 	//
       
   249 private:
       
   250 	TPckgBuf<TMsvIndexLoadProgress> iProgress;
       
   251 	TInt iDrive;
       
   252 	CMsvServer& iServer;
       
   253 	};
       
   254 #endif
       
   255 
       
   256