photosgallery/common/inc/glxcommandfactory.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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:    Command object factory
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef T_GLXCOMMANDFACTORY_H
       
    22 #define T_GLXCOMMANDFACTORY_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <glxmediageneraldefs.h>
       
    26 #include <glxmediaid.h>
       
    27 #include <lbsposition.h> 
       
    28 #include <mpxcommand.h>
       
    29 
       
    30 class CMPXCollectionPath;
       
    31 class MGlxMediaList;
       
    32 
       
    33 /**
       
    34  * TGlxCommandFactory
       
    35  *
       
    36  * Factory that creates CMPXCommand objects that can be issued via 
       
    37  * CGlxMediaListCommandHandler::IssueCommandL
       
    38  *
       
    39  * @lib glxcommoncommandhandlers.lib
       
    40  */
       
    41  NONSHARABLE_CLASS (TGlxCommandFactory)
       
    42     {
       
    43 public:
       
    44     /**
       
    45      * Creates a basic command, when a method to create a specific command is 
       
    46      * not available. Use of the more specific methods below instead of this method is encouranged.
       
    47      *
       
    48      * @param aCommandId Id of the MPX command 
       
    49      * @param aPath aSourcePath path for using as source items (i.e., selection information)
       
    50      *                          and collection plugin id
       
    51      *                          Will be included in the command object in
       
    52      *                          KMPXCommandGeneralSourceIds
       
    53      * @return a command object that has the following attributes filled in:
       
    54      *          KMPXCommandGeneralId
       
    55      *          KMPXCommandGeneralCollectionId
       
    56      *          KMPXCommandGeneralSourcePath (if requested)
       
    57      */
       
    58     IMPORT_C static CMPXCommand* BasicCommandLC(TInt aCommandId, const CMPXCollectionPath& aSourcePath);   
       
    59 
       
    60     /**
       
    61      * Creates a command object to add a new container (album or tag).
       
    62      * 
       
    63      * @param aTitle Title (name) of the new container.
       
    64      * @param aCollectionId Id of the collection (plugin) to which the new container
       
    65      *                      will be added.
       
    66      * @return a command object. 
       
    67      */
       
    68     IMPORT_C static CMPXCommand* AddContainerCommandLC(const TDesC& aTitle, TInt aCollectionUid);
       
    69     
       
    70     /**
       
    71      * Creates a command object to add items to a container.
       
    72      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
    73      *                 or selected will be added.
       
    74      * @param aSourceItems Items to add to the container.
       
    75      * @param aTargetContainers Containers that items will be added to. 
       
    76      *                 Only containers that are focused (using CMPXCollectionPath::Set()) 
       
    77      *                 or selected will have the items added to them.
       
    78      * @return a command object. 
       
    79      */
       
    80     IMPORT_C static CMPXCommand* AddToContainerCommandLC(
       
    81         const CMPXCollectionPath& aSourceItems,
       
    82         const CMPXCollectionPath& aTargetContainers);
       
    83         
       
    84     /**
       
    85      * Creates a command object to add items to a container
       
    86      * @param aUri source item uri.
       
    87      * @param aTargetContainers Containers that item will be added to. 
       
    88      *                 Only containers that are focused (using CMPXCollectionPath::Set()) 
       
    89      *                 or selected will have the item added to them.
       
    90      * @return a command object. 
       
    91      */
       
    92     IMPORT_C static CMPXCommand* AddToContainerCommandLC(
       
    93             const TDesC& aUri, 
       
    94             const CMPXCollectionPath& aTargetContainers);
       
    95 
       
    96     /**
       
    97      * Creates a command object to move items to a different drive
       
    98      * @param aTargetDrive Drive to move files to, in format "C:\"
       
    99      * @param aSourcePath Path to be used for selection and collection plugin id.
       
   100      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   101      *                 or selected will be moved.
       
   102      * @return a command object.
       
   103      */
       
   104     IMPORT_C static CMPXCommand* MoveCommandLC(const TDesC& aTargetDrive, 
       
   105         const CMPXCollectionPath& aSourcePath);
       
   106 
       
   107     /**
       
   108      * Creates a command object to copy items to a different drive
       
   109      * @param aTargetDrive Drive to copy files to, in format "C:\".
       
   110      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   111      *                 or selected will be copied.
       
   112      * @param aSourcePath Path to be used for selection and collection plugin id.
       
   113      * @return a command object. 
       
   114      */
       
   115     IMPORT_C static CMPXCommand* CopyCommandLC(const TDesC& aTargetDrive, 
       
   116         const CMPXCollectionPath& aSourcePath);
       
   117 
       
   118     /**
       
   119      * Creates a command object for renaming a media object (container or file)
       
   120      * @param aNewTitle New title (or name) for the object.
       
   121      * @param aList Media list with the item that should be renamed in focus.
       
   122      *              Panics if more than one item has been selected on the media list.
       
   123      *              Panics if media list is empty.
       
   124      *              Panics if media list has a static item in focus.
       
   125      * @return a command object.
       
   126      */
       
   127     IMPORT_C static CMPXCommand* RenameCommandLC(const TDesC& aNewTitle, 
       
   128         const CMPXCollectionPath& aSourcePath);
       
   129 
       
   130     /**
       
   131      * Creates a command object for deleting a media object. If media 
       
   132      * object is a file, it will be deleted when the command is issued.
       
   133      * @param aSourcePath Path to be used for selection and collection plugin id
       
   134      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   135      *                 or selected will be deleted.
       
   136      * @return a command object.
       
   137      */
       
   138     IMPORT_C static CMPXCommand* DeleteCommandLC(const CMPXCollectionPath& aSourcePath);
       
   139 
       
   140     /**
       
   141      * Creates a command object to remove items from a container.
       
   142      * 
       
   143      * @param aSourcePath Path to be used for selection and collection plugin id.
       
   144      *                 Uses the parent item in the path as the container to remove from.
       
   145      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   146      *                 or selected will be removed.
       
   147      * @return a command object. 
       
   148      */
       
   149     IMPORT_C static CMPXCommand* RemoveFromContainerCommandLC(const CMPXCollectionPath& aSourcePath);
       
   150 
       
   151     /**
       
   152      * Creates a command object to remove items from a specific container.
       
   153      * 
       
   154      * @param aContainerId Id of the container to remove from.
       
   155      * @param aSourcePath Path to be used for selection and collection plugin id.
       
   156      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   157      *                 or selected will be removed.
       
   158      * @return a command object. 
       
   159      */
       
   160     IMPORT_C static CMPXCommand* RemoveFromContainerCommandLC(TGlxMediaId aContainerId, 
       
   161         const CMPXCollectionPath& aSourcePath);
       
   162     
       
   163     /**
       
   164      * Creates a command object to set the description of an object.
       
   165      * @param aDescription Description to set.
       
   166      * @param aSourcePath Path to be used for selection and collection plugin id.
       
   167      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   168      *                 or selected will have their descriptions set.
       
   169      * @return a command object.
       
   170      */
       
   171     IMPORT_C static CMPXCommand* SetDescriptionCommandLC(const TDesC& aDescription, 
       
   172         const CMPXCollectionPath& aSourcePath);
       
   173 
       
   174     /**
       
   175      * Creates a command object to delete the location information associated with an object.
       
   176      * @param aSourcePath Path to be used for selection and collection plugin id
       
   177      *                 Only items that are focused (using CMPXCollectionPath::Set())
       
   178      *                 or selected will have their location deleted.
       
   179      * @return a command object.
       
   180      */
       
   181     IMPORT_C static CMPXCommand* DeleteLocationCommandLC(const CMPXCollectionPath& aSourcePath);
       
   182     
       
   183     /**
       
   184      * Creates a command that cleans up thumbnails.
       
   185      * @todo Improve method description.
       
   186      * @return a command object.
       
   187      */
       
   188     IMPORT_C static CMPXCommand* ThumbnailCleanupCommandLC();
       
   189     
       
   190     };
       
   191 
       
   192 #endif // T_GLXCOMMANDFACTORY_H