|
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: Preference store interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HSIPREFERENCESTORE_H |
|
19 #define HSIPREFERENCESTORE_H |
|
20 |
|
21 class QString; |
|
22 |
|
23 |
|
24 /*DEPRECATED |
|
25 \class IHsPreferenceStore |
|
26 \brief Interface class for preference store. |
|
27 |
|
28 The preference store is a key/value store with both the key and |
|
29 the value being strings. The widget may store data to be reused |
|
30 at a later date, such as a username, settings for the widget, persistent data, |
|
31 and so on. The data is stored on the device, for example on its hard drive, |
|
32 and can be read back at any time. |
|
33 */ |
|
34 class IHsPreferenceStore |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /*! |
|
40 Virtual destructor. |
|
41 */ |
|
42 virtual ~IHsPreferenceStore() {}; |
|
43 |
|
44 /*! |
|
45 Save a widget preference. |
|
46 This method will store the given value in the widget |
|
47 in the widget preference store for the given key. |
|
48 |
|
49 The preference store is unique to this widget and any values |
|
50 stored in it are persisted if the widget is reloaded or closed |
|
51 and started again. |
|
52 |
|
53 If a value for the given key already exists, it is silently |
|
54 overwritten. Storing an empty string for the given key will |
|
55 create an entry for the given key with an empty string as its value. |
|
56 |
|
57 \a id HsWidget's unique identifier |
|
58 \a key The string to save the preference under. |
|
59 \a value The value of the preference. |
|
60 */ |
|
61 virtual bool setPreferenceForKey(int id, const QString &key, const QString &value) = 0; |
|
62 |
|
63 /*! |
|
64 Get a preference from the widget preference store. |
|
65 Get the value stored for the given key in the widget preference store. |
|
66 If there is no value for the given key, an empty string is returned. |
|
67 |
|
68 \a id HsWidget's unique identifier |
|
69 \a key The preference to get from the preference store. |
|
70 \a value The value of the preference is written to this object. |
|
71 */ |
|
72 virtual bool preferenceForKey(int id, const QString &key, QString &value) = 0; |
|
73 |
|
74 }; |
|
75 |
|
76 #endif |