applayerpluginsandutils/bookmarksupport/src/bkmrkfolder.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2005-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 // Classes for manipulating bookmarks and bookmark folders.
       
    15 // @internalComponent
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __BKMRKFOLDER_H__
       
    20 #define __BKMRKFOLDER_H__
       
    21 
       
    22 #include "bkmrkbase.h"
       
    23 #include "bkmrkproperties.h"
       
    24 
       
    25 const Bookmark::TItemId KFolderIdMaskID = 0x80000000;
       
    26 
       
    27 /**
       
    28 Internal representation of a bookmark folder. It contains the folder specific properties and holds
       
    29 a pointer to an extended properties object. This object is only loaded when needed. 
       
    30 A folder holds a list of child bookmark items. These can be either bookmarks or further folders.
       
    31 CBookmarkFolder provides methods for inserting, removing and moving these child bookmark items.
       
    32 */
       
    33 class CBookmarkFolder: public CBookmarkBase
       
    34 	{
       
    35 public:
       
    36 	static CBookmarkFolder* NewL(CBookmarkFolder* aParent, CBookmarkDb& aDb);
       
    37 	~CBookmarkFolder();
       
    38 	void DeleteL();
       
    39 
       
    40 	// From CBookmarkBase
       
    41 	Bookmark::TType Type() const;
       
    42 
       
    43 	RBkFolder OpenFolder();
       
    44 
       
    45 	void SendChildrenToFolderL(CBookmarkFolder& aFolder);
       
    46 
       
    47 	void AppendL(CBookmarkBase& aBookmarkItem);
       
    48 	void InsertL(CBookmarkBase& aBookmarkItem, TInt aIndexPosition);
       
    49 
       
    50 	TInt Move(TInt aOldPosition, TInt aNewPosition);
       
    51 	TInt Count() const;
       
    52 
       
    53 	TInt Index(CBookmarkBase& aBookmarkItem) const;
       
    54 	TInt Find(Bookmark::TItemId aId) const;
       
    55 
       
    56 	CBookmarkBase& At(TInt aIndex);
       
    57 
       
    58 	void Remove(CBookmarkBase& aBookmarkItem);
       
    59 	void Reset();
       
    60 
       
    61 	CBkmrkProperties& BkmrkPropertiesL();
       
    62 
       
    63 	// From CRepositoryAccessor
       
    64 	TUint32 IndexBase();
       
    65 	void SetIdFromIndexBase(TUint32 aIndexBase);
       
    66 	void TransSaveL();
       
    67 	void TransNewL();
       
    68 	void TransLoadL();
       
    69 	void TransRemoveL();
       
    70 	
       
    71 private:
       
    72 	CBookmarkFolder(CBookmarkDb& aDb);
       
    73 	void ConstructL(CBookmarkFolder* aParent);
       
    74 
       
    75 private:
       
    76 	RArray<CBookmarkBase*>			iChildren;
       
    77 	CBkmrkProperties*				iProperties;
       
    78 	};
       
    79 
       
    80 #endif //__BKMRKFOLDER_H__