|
1 /* |
|
2 * Copyright (c) 2002-2006 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: This class is used to provide localized names |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CGFLMITEMLOCALIZER_H |
|
21 #define CGFLMITEMLOCALIZER_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CDirectoryLocalizer; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * This class is used to provide localized names to files and directories |
|
36 * |
|
37 * @lib GFLM.lib |
|
38 * @since 2.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS(CGflmItemLocalizer) : public CBase |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CGflmItemLocalizer* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CGflmItemLocalizer(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Get the localized name of a file or a directory by it's path. |
|
58 * Works only in main thread context. |
|
59 * @since 2.0 |
|
60 * @param aPath A descriptor containing the full path to be localized |
|
61 * @return A TPtrC object containing the localized name. KNullDesC |
|
62 * if no localized name is defined. |
|
63 */ |
|
64 TPtrC Localize( const TDesC& aPath ) const; |
|
65 |
|
66 /** |
|
67 * Get the localized name of a file or a directory by it's path |
|
68 * Works only in work thread context. |
|
69 * @since 3.2 |
|
70 * @param aPath A descriptor containing the full path to be localized |
|
71 * @return A TPtrC object containing the localized name. KNullDesC |
|
72 * if no localized name is defined. |
|
73 */ |
|
74 TPtrC LocalizeFromWorkThread( const TDesC& aPath ) const; |
|
75 |
|
76 /** |
|
77 * Setups localizer for work thread |
|
78 * Works only in work thread context. |
|
79 * @since 3.2 |
|
80 */ |
|
81 void SetupWorkThreadLocalizerL(); |
|
82 |
|
83 /** |
|
84 * Releases localizer used by work thread |
|
85 * Works only in work thread context. |
|
86 * @since 3.2 |
|
87 */ |
|
88 void ReleaseWorkThreadLocalizer(); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CGflmItemLocalizer(); |
|
96 |
|
97 void ConstructL(); |
|
98 |
|
99 TPtrC Localize( |
|
100 CDirectoryLocalizer& aLocalizer, const TDesC& aPath ) const; |
|
101 |
|
102 private: // Data |
|
103 // Own: For localising in main thread context |
|
104 CDirectoryLocalizer* iLocalizer; |
|
105 |
|
106 // Own: For localising in work thread context |
|
107 CDirectoryLocalizer* iWorkThreadLocalizer; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // CGFLMITEMLOCALIZER_H |
|
112 |
|
113 // End of File |