wvuing/wvuistorage/inc/MCAStoredGroups.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003-2005 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:  Stored group data container interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCASTOREDGROUPS_H
       
    21 #define MCASTOREDGROUPS_H
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <badesca.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MCAStoredGroup;
       
    28 class MCAExtendedStoredGroup;
       
    29 class MCAStoredGroupsObserver;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  *  Interface for stored groups container
       
    35  *
       
    36  *  @lib CAStorage.dll
       
    37  *  @since 2.1
       
    38  */
       
    39 class MCAStoredGroups
       
    40     {
       
    41     public: // New functions
       
    42 
       
    43         /**
       
    44          * Add an observer.
       
    45          * @since 2.1
       
    46          * @param aObserver The observer
       
    47          */
       
    48         virtual void AddObserverL( MCAStoredGroupsObserver*
       
    49                                    aObserver ) = 0;
       
    50 
       
    51         /**
       
    52          * Remove an observer.
       
    53          * @since 2.1
       
    54          * @param aObserver The observer
       
    55          */
       
    56         virtual void RemoveObserver( MCAStoredGroupsObserver*
       
    57                                      aObserver ) = 0;
       
    58 
       
    59         /**
       
    60          * Create a new group.
       
    61          * Ownership is not transferred to the caller.
       
    62          * @since 2.1
       
    63          * @return The created contact
       
    64          */
       
    65         virtual MCAExtendedStoredGroup* CreateGroupL() = 0;
       
    66 
       
    67         /**
       
    68          * Remove a given group
       
    69          * @since 2.1
       
    70          * @param aContact The contact to remove
       
    71          */
       
    72         virtual void DeleteGroupL( MCAStoredGroup* aGroup ) = 0;
       
    73 
       
    74         /**
       
    75          * Find a group from the store
       
    76          * @since 2.1
       
    77          * @param aId the ID of the group to find
       
    78          * @return The group
       
    79          */
       
    80         virtual MCAStoredGroup* FindGroup( const TDesC& aId ) = 0;
       
    81 
       
    82         /**
       
    83          * Populate the given list with groups
       
    84          * @since 2.1
       
    85          * @param aList The list to populate
       
    86          * @param aReturnOnlyVisible Return only groups marked visible (ETrue)
       
    87          */
       
    88         virtual void PopulateGroupsListL(
       
    89             RPointerArray<MCAStoredGroup>& aList,
       
    90             TBool aReturnOnlyVisible = ETrue ) = 0;
       
    91 
       
    92         /**
       
    93          * Signal change in this group. Using this method is responsibility of
       
    94          * the client which changes data contained within MCAStoredGroup. The
       
    95          * client may also choose to not signal the change event.
       
    96          * @since 2.1
       
    97          * @param aGroupId The group id
       
    98          */
       
    99         virtual void SignalGroupChangedL( const TDesC& aGroupId ) = 0;
       
   100 
       
   101         /**
       
   102          * Signal an added group. Using this method is responsibility of
       
   103          * the client which creates the group and sets its name. The
       
   104          * client may also choose to not signal the addition event.
       
   105          * @since 2.1
       
   106          * @param aGroupId The group id
       
   107          */
       
   108         virtual void SignalGroupAddedL( const TDesC& aGroupId ) = 0;
       
   109 
       
   110         /**
       
   111          * Save the changes made to the given group. This also takes care of
       
   112          * informing the observers. An alternative is to use the
       
   113          * SignalGroupChangedL, which only signals about changes, but does not
       
   114          * save the group.
       
   115          * @since 2.1
       
   116          * @param aGroupId The id of the group to save
       
   117          */
       
   118         virtual void SaveGroupL( const TDesC& aGroupId ) = 0;
       
   119 
       
   120         /**
       
   121          * Make all own groups hidden by setting their visibility-flag.
       
   122          * @param aAllGroups If ETrue, hides other than user's own groups also.
       
   123          *        This can be used when the group-operations are not supported
       
   124          *        by the server and all storage groups must be hidden.
       
   125          */
       
   126         virtual void HideAllGroups( TBool aAllGroups = EFalse ) = 0;
       
   127 
       
   128         /**
       
   129          * Make all groups shown by unsetting their visibility-flag
       
   130          */
       
   131         virtual void ShowAllGroups() = 0;
       
   132 
       
   133         /**
       
   134          *  Count of stored groups
       
   135          *  @since 2.6
       
   136          *  @return Count of groups
       
   137          */
       
   138         virtual TInt GroupCount( TBool aOnlyVisible ) const = 0;
       
   139 
       
   140         /**
       
   141          * Check flash memory level. Leaves with KErrDiskFull
       
   142          * if memory level below critical level.
       
   143          * @since 3.1
       
   144          * @param aGroup Group that is going to be written to database.
       
   145          */
       
   146         virtual void CheckFreespaceLevelL( MCAExtendedStoredGroup* aGroup ) = 0;
       
   147 
       
   148 
       
   149 
       
   150         /**
       
   151         * Check whether group is deleted before joining or not
       
   152         * @since 3.1
       
   153         * @return ETrue or EFalse.
       
   154         */
       
   155         virtual TBool IsGroupDeleted() = 0;
       
   156 
       
   157         /**
       
   158         * set whether group is deleted before joining or not
       
   159         * @since 3.1
       
   160         * @param aValue boolean value.
       
   161         */
       
   162         virtual void SetGroupDeleted( TBool aValue ) = 0 ;
       
   163 
       
   164 
       
   165     };
       
   166 
       
   167 #endif      // MCASTOREDGROUPS_H
       
   168 
       
   169 // End of File