|
1 /* |
|
2 * Copyright (c) 2002-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: Implements image handler class for document handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "DocImageHandler.h" |
|
20 #include "DocSaver.h" // CDocAsyncSaver |
|
21 |
|
22 // CONSTANTS |
|
23 static const TInt KPhotoAlbumMaxNameLength(40); |
|
24 |
|
25 // --------------------------------------------------------- |
|
26 // Constructor |
|
27 // --------------------------------------------------------- |
|
28 CDocImageHandler::CDocImageHandler( |
|
29 const TDataType& aDataType, |
|
30 const TUid& aUid, |
|
31 CDocumentHandler* aDocDispatcher) : |
|
32 CDocDefaultHandler( aDataType, aUid, aDocDispatcher, EDocOpenAndSave ) |
|
33 { |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // void CDocImageHandler::ConstructL(..) |
|
38 // Epoc constructor. In addition to defaultHandlers |
|
39 // tasks constructs a CPAlbImageUtil object. |
|
40 // --------------------------------------------------------- |
|
41 void CDocImageHandler::ConstructL() |
|
42 { |
|
43 BaseConstructL(); |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // CDocImageHandler::~CDocImageHandler() |
|
48 // Destructor |
|
49 // --------------------------------------------------------- |
|
50 CDocImageHandler::~CDocImageHandler() |
|
51 { |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------- |
|
55 // CDocImageHandler* CDocImageHandler::NewL(..) |
|
56 // Returns a contructed CDocImageHandler object |
|
57 // --------------------------------------------------------- |
|
58 CDocImageHandler* CDocImageHandler::NewL( |
|
59 const TDataType& aDataType, |
|
60 const TUid& aUid, |
|
61 CDocumentHandler* aDocDispatcher) |
|
62 { |
|
63 CDocImageHandler* self = CDocImageHandler::NewLC( aDataType, |
|
64 aUid, aDocDispatcher ); |
|
65 CleanupStack::Pop(); // self |
|
66 return self; |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------- |
|
70 // CDocImageHandler* CDocImageHandler::NewLC(..) |
|
71 // Returns a contructed CDocImageHandler object. Leaves |
|
72 // the object in the cleanup stack. |
|
73 // --------------------------------------------------------- |
|
74 CDocImageHandler* CDocImageHandler::NewLC( |
|
75 const TDataType& aDataType, |
|
76 const TUid& aUid, |
|
77 CDocumentHandler* aDocDispatcher) |
|
78 { |
|
79 CDocImageHandler * self = |
|
80 new( ELeave ) CDocImageHandler( aDataType, aUid, |
|
81 aDocDispatcher ); |
|
82 CleanupStack::PushL( self ); |
|
83 self->ConstructL( ); |
|
84 return self; |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------- |
|
88 // CDocImageHandler::PopulateAppInfo() |
|
89 // Construct iAppInfo with KImageViewerUID . |
|
90 // --------------------------------------------------------- |
|
91 // |
|
92 void CDocImageHandler::PopulateAppInfo() |
|
93 { |
|
94 CDocDefaultHandler::PopulateAppInfo( KImageViewerUID ); |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------- |
|
98 // CDocDefaultHandler::MaxNameLen() |
|
99 // Return max lenght of file name, in case of images it is |
|
100 // different than normal file max length. |
|
101 // --------------------------------------------------------- |
|
102 // |
|
103 TInt CDocImageHandler::MaxNameLen() |
|
104 { |
|
105 return KPhotoAlbumMaxNameLength; |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------- |
|
109 // CDocDefaultHandler::HideFileExtension() |
|
110 // Should we hide file extension (in case of images, we |
|
111 // should hide). |
|
112 // --------------------------------------------------------- |
|
113 // |
|
114 TBool CDocImageHandler::HideFileExtension() |
|
115 { |
|
116 return ETrue; |
|
117 } |
|
118 |
|
119 |
|
120 |
|
121 // End of File |