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