36
|
1 |
/*
|
|
2 |
* Copyright (c) 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: stub central repository -class for testing CVideoCollectionClient
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __CENTRALREPOSITORY_H__
|
|
19 |
#define __CENTRALREPOSITORY_H__
|
|
20 |
|
|
21 |
#include <e32base.h>
|
|
22 |
#include <qmap.h>
|
|
23 |
|
|
24 |
class CRepository
|
|
25 |
{
|
|
26 |
public:
|
|
27 |
|
|
28 |
/**
|
|
29 |
* sets gCRNewLLeave
|
|
30 |
*/
|
|
31 |
static void setNewLLeave(bool leave);
|
|
32 |
|
|
33 |
/**
|
|
34 |
* sets gCRSetFail
|
|
35 |
*/
|
|
36 |
static void setSetFail(int amount);
|
|
37 |
|
|
38 |
/**
|
|
39 |
* sets gCRGetFail
|
|
40 |
*/
|
|
41 |
static void setGetFail(int amount);
|
|
42 |
|
|
43 |
/**
|
|
44 |
* gets gSettedTDesValue;
|
|
45 |
*/
|
|
46 |
static TDesC& getTDesValue();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* sets gSettedTDesValue;
|
|
50 |
*/
|
|
51 |
static void setTDesValue(const TDesC& value);
|
|
52 |
|
|
53 |
|
|
54 |
static QMap<uint, int> mSortValues;
|
|
55 |
|
|
56 |
/**
|
|
57 |
* if gCRNewLLeave is true, will leave
|
|
58 |
* if gCRNewLLeave is false returns new CRepository
|
|
59 |
*/
|
|
60 |
static CRepository* NewL(TUid aRepositoryUid);
|
|
61 |
|
|
62 |
/**
|
|
63 |
* contructor
|
|
64 |
*/
|
|
65 |
CRepository();
|
|
66 |
|
|
67 |
/**
|
|
68 |
* destructor
|
|
69 |
*/
|
|
70 |
virtual ~CRepository();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* if gCRGetFail is true, returns KErrGeneral
|
|
74 |
* if gCRGetFail is false, returns gSettedValue and returns KErrNone
|
|
75 |
*/
|
|
76 |
TInt Get(TUint32 aKey, TInt& aValue);
|
|
77 |
|
|
78 |
/**
|
|
79 |
* if gCRSetFail is true, returns KErrGeneral
|
|
80 |
* if gCRSetFail is false, saves value to gSettedValue and returns KErrNone
|
|
81 |
*/
|
|
82 |
TInt Set(TUint32 aKey, TInt aValue);
|
|
83 |
|
|
84 |
/**
|
|
85 |
* if gCRGetFail is true, returns KErrGeneral
|
|
86 |
* if gCRGetFail is false, returns gSettedValue and returns KErrNone
|
|
87 |
*/
|
|
88 |
TInt Get(TUint32 aKey, TDes& aValue);
|
|
89 |
|
|
90 |
|
|
91 |
};
|
|
92 |
|
|
93 |
#endif // __CENTRALREPOSITORY_H__
|