photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatadialog.cpp
branchRCL_3
changeset 75 01504893d9cb
parent 60 5b3385a43d68
equal deleted inserted replaced
68:5b238bc8ffb6 75:01504893d9cb
    18 
    18 
    19 #include "glximgvwrmetadatadialog.h"
    19 #include "glximgvwrmetadatadialog.h"
    20 
    20 
    21 //system includes
    21 //system includes
    22 #include <AknUtils.h>                   //for AknUtils
    22 #include <AknUtils.h>                   //for AknUtils
       
    23 #include <lbsposition.h> 
    23 #include <akntitle.h>
    24 #include <akntitle.h>
       
    25 #include <coeaui.h>
    24 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR 
    26 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR 
       
    27 #include <eikmenub.h>                   // for CEikMenuBar
    25 #include <StringLoader.h>
    28 #include <StringLoader.h>
    26 #include <akntoolbar.h>
    29 #include <akntoolbar.h>
       
    30 #include <glxcommandhandleraddtocontainer.h>         // For CGlxCommandHandlerAddToContainer
    27 
    31 
    28 //User includes
    32 //User includes
    29 #include <glxmetadatadialog.rsg>
    33 #include <glxmetadatadialog.rsg>
    30 #include <glxresourceutilities.h>
    34 #include <glxresourceutilities.h>
    31 #include <glxlog.h>
    35 #include <glxlog.h>
    32 #include <glxtracer.h>
    36 #include <glxtracer.h>
       
    37 #include <glxcollectionpluginall.hrh>
       
    38 #include <glxfilterfactory.h>               // for TGlxFilterFactory
       
    39 #include <glxuiutility.h>
    33 #include <glxcommandhandlers.hrh>
    40 #include <glxcommandhandlers.hrh>
       
    41 #include <hlplch.h>                     // for HlpLauncher
       
    42 #include <photos.hlp.hrh>
       
    43 #include <glxgallery.hrh>
    34 #include <glxdetailsboundcommand.hrh>
    44 #include <glxdetailsboundcommand.hrh>
       
    45 #include <glxscreenfurniture.h>
       
    46 #include <glxuiutilities.rsg>
       
    47 #include <glxpanic.h>                    // For Panics
    35 #include "glxmetadatacommandhandler.h"
    48 #include "glxmetadatacommandhandler.h"
    36 
    49 
    37 // ============================ MEMBER FUNCTIONS ===============================
    50 // ============================ MEMBER FUNCTIONS ===============================
    38 
    51 
    39 // -----------------------------------------------------------------------------
    52 // -----------------------------------------------------------------------------
    49     self->ConstructL();
    62     self->ConstructL();
    50     CleanupStack::Pop( self );
    63     CleanupStack::Pop( self );
    51     return self;
    64     return self;
    52     }
    65     }
    53 
    66 
    54 // -----------------------------------------------------------------------------
       
    55 // CGlxImgVwrMetadataDialog
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CGlxImgVwrMetadataDialog::CGlxImgVwrMetadataDialog(const TDesC& aUri):iUri(aUri)
    67 CGlxImgVwrMetadataDialog::CGlxImgVwrMetadataDialog(const TDesC& aUri):iUri(aUri)
    59     {
    68     {
    60     }
    69 
    61 
    70     }
    62 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    63 // ConstructL
    72 // ConstructL
    64 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
    65 //
    74 //
    66 void CGlxImgVwrMetadataDialog::ConstructL()
    75 void CGlxImgVwrMetadataDialog::ConstructL()
    82     if(statusPane && statusPane->IsVisible())
    91     if(statusPane && statusPane->IsVisible())
    83         {
    92         {
    84         iStatusPaneAvailable = ETrue;       
    93         iStatusPaneAvailable = ETrue;       
    85         }
    94         }
    86 
    95 
       
    96     // make the toolbar disabled
       
    97     SetDetailsDlgToolbarVisibility(EFalse);        
       
    98 
    87     // do we have status pane
    99     // do we have status pane
    88     if( statusPane )
   100     if( statusPane )
    89         {
   101         {
    90         GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d",
   102         GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible());    
    91                 statusPane->IsVisible());    
       
    92         // load the title text
   103         // load the title text
    93         HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, iEikonEnv );
   104         HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, iEikonEnv );
    94         SetTitleL( *text );
   105         SetTitleL( *text );
    95         if( text)
   106         if( text)
    96             {
   107             {
    97             delete text;
   108             delete text;
    98             }
   109             }
    99         iAvkonAppUi->StatusPane()->MakeVisible(ETrue);             
   110         iAvkonAppUi->StatusPane()->MakeVisible(ETrue);             
   100         }
   111         }
       
   112 
       
   113     iUiUtility = CGlxUiUtility::UtilityL(); 
       
   114 
   101     } 
   115     } 
   102 
   116 
   103 // -----------------------------------------------------------------------------
   117 // -----------------------------------------------------------------------------
   104 // ~CGlxImgVwrMetadataDialog
   118 // ~CGlxImgVwrMetadataDialog
   105 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   106 //
   120 //
   107 CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog()
   121 CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog()
   108     {
   122     {
       
   123 
   109     TRACER("CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog");
   124     TRACER("CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog");
       
   125 
   110 
   126 
   111     //To Disable the status pane if the dialog is launched from fullscreenview  
   127     //To Disable the status pane if the dialog is launched from fullscreenview  
   112     if (!iStatusPaneAvailable && iAvkonAppUi)
   128     if (!iStatusPaneAvailable && iAvkonAppUi)
   113         {
   129         {
   114         iAvkonAppUi->StatusPane()->MakeVisible(EFalse);
   130         iAvkonAppUi->StatusPane()->MakeVisible(EFalse);
   125     if (iAvkonAppUi)
   141     if (iAvkonAppUi)
   126         {
   142         {
   127         TRAP_IGNORE(iAvkonAppUi->ProcessCommandL(EGlxCmdResetView));
   143         TRAP_IGNORE(iAvkonAppUi->ProcessCommandL(EGlxCmdResetView));
   128         }
   144         }
   129 
   145 
       
   146     if( iUiUtility )
       
   147         {
       
   148         iUiUtility->Close();
       
   149         }
       
   150 
   130     if (iResourceOffset)
   151     if (iResourceOffset)
   131         {
   152         {
   132         CCoeEnv::Static()->DeleteResourceFile(iResourceOffset);
   153         CCoeEnv::Static()->DeleteResourceFile(iResourceOffset);
   133         }   
   154         }   
   134     }
   155     }
   156 EXPORT_C TInt CGlxImgVwrMetadataDialog::ExecuteLD()
   177 EXPORT_C TInt CGlxImgVwrMetadataDialog::ExecuteLD()
   157     {
   178     {
   158     TRACER("CGlxImgVwrMetadataDialog::ExecuteLD");     
   179     TRACER("CGlxImgVwrMetadataDialog::ExecuteLD");     
   159     return CAknDialog::ExecuteLD( R_IMG_VIEWER_METADATA_DIALOG );
   180     return CAknDialog::ExecuteLD( R_IMG_VIEWER_METADATA_DIALOG );
   160     }
   181     }
   161 
       
   162 // -----------------------------------------------------------------------------
   182 // -----------------------------------------------------------------------------
   163 // ProcessCommandL
   183 // ProcessCommandL
   164 // -----------------------------------------------------------------------------
   184 // -----------------------------------------------------------------------------
   165 //
   185 //
   166 void CGlxImgVwrMetadataDialog::ProcessCommandL(TInt /*aCommandId*/)
   186 void CGlxImgVwrMetadataDialog::ProcessCommandL( TInt aCommandId )
   167     {
   187     {
   168     TRACER("CGlxImgVwrMetadataDialog::ProcessCommandL");
   188     TRACER("CGlxImgVwrMetadataDialog::ProcessCommandL");
   169     // hide menu bar
   189     // hide menu bar
   170     iMenuBar->StopDisplayingMenuBar();
   190     iMenuBar->StopDisplayingMenuBar();
   171     }
   191     }
   172 
       
   173 //-----------------------------------------------------------------------------
   192 //-----------------------------------------------------------------------------
   174 // CGlxImgVwrMetadataDialog::CreateCustomControlL
   193 // CGlxImgVwrMetadataDialog::CreateCustomControlL
   175 //-----------------------------------------------------------------------------
   194 //-----------------------------------------------------------------------------
   176 SEikControlInfo CGlxImgVwrMetadataDialog::CreateCustomControlL(TInt 
   195 SEikControlInfo CGlxImgVwrMetadataDialog::CreateCustomControlL(TInt 
   177         aControlType)
   196         aControlType)
   178     {
   197     {
   179     GLX_LOG_INFO("CGlxImgVwrMetadataDialog::CreateCustomControlL");
   198     GLX_LOG_INFO("CShwSlideshowSettingsDialog::CreateCustomControlL");
   180 
   199 
   181     // create control info, no flags or trailer text set
   200     // create control info, no flags or trailer text set
   182     SEikControlInfo controlInfo;
   201     SEikControlInfo controlInfo;
   183     controlInfo.iControl = NULL;
   202     controlInfo.iControl        = NULL;
   184     controlInfo.iTrailerTextId = 0;
   203     controlInfo.iTrailerTextId  = 0;
   185     controlInfo.iFlags = 0;
   204     controlInfo.iFlags          = 0;
   186     if (aControlType == EMetaDataDialogListBox)
   205     if (aControlType == EMetaDataDialogListBox)
   187         {
   206         {
   188         iContainer = CGlxImgVwrMetadataContainer::NewL(
   207         iContainer = CGlxImgVwrMetadataContainer::NewL(iAvkonAppUi->ClientRect(),iUri);        
   189                 iAvkonAppUi->ClientRect(), iUri);
       
   190         controlInfo.iControl = iContainer; // giving ownership   
   208         controlInfo.iControl = iContainer; // giving ownership   
   191         }
   209         }
   192     return controlInfo; // returns ownership of ItemList
   210     return controlInfo; // returns ownership of ItemList
   193     }
   211     }
   194 
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // CGlxImgVwrMetadataDialog::DynInitMenuPaneL
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 void CGlxImgVwrMetadataDialog::DynInitMenuPaneL(TInt /*aMenuId*/,
       
   218         CEikMenuPane* /*aMenuPane*/)
       
   219     {
       
   220     //no implementation
       
   221     }
       
   222 
       
   223 //-----------------------------------------------------------------------------
       
   224 // CGlxImgVwrMetadataDialog::SizeChanged
       
   225 //-----------------------------------------------------------------------------
       
   226 void CGlxImgVwrMetadataDialog::SizeChanged()
       
   227     {
       
   228     TRACER("CGlxImgVwrMetadataDialog::SizeChanged");
       
   229     CAknDialog::SizeChanged();
       
   230     }
   195 // -----------------------------------------------------------------------------
   231 // -----------------------------------------------------------------------------
   196 // CGlxImgVwrMetadataDialog::InitResourceL
   232 // CGlxImgVwrMetadataDialog::InitResourceL
   197 // -----------------------------------------------------------------------------
   233 // -----------------------------------------------------------------------------
   198 //
   234 //
   199 void CGlxImgVwrMetadataDialog::InitResourceL()    
   235 void CGlxImgVwrMetadataDialog::InitResourceL()    
   208     resourceFile.Append(parse.FullName()); 
   244     resourceFile.Append(parse.FullName()); 
   209     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   245     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   210     iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   246     iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   211     }  
   247     }  
   212 
   248 
       
   249 
       
   250 // -----------------------------------------------------------------------------
       
   251 // CGlxImgVwrMetadataDialog::HandleViewCommandL
       
   252 // -----------------------------------------------------------------------------
       
   253 //    
       
   254 TBool CGlxImgVwrMetadataDialog::HandleViewCommandL( TInt /*aCommand*/ )
       
   255     {
       
   256     TRACER("CGlxImgVwrMetadataDialog::HandleViewCommandL");
       
   257     return EFalse;
       
   258     }
       
   259 // ---------------------------------------------------------------------------
       
   260 // CGlxImgVwrMetadataDialog::PreLayoutDynInitL
       
   261 // ---------------------------------------------------------------------------
       
   262 //
       
   263 void CGlxImgVwrMetadataDialog::PreLayoutDynInitL()
       
   264     {
       
   265     // No Implementation
       
   266     }
       
   267 
       
   268 //-----------------------------------------------------------------------------
       
   269 // CGlxImgVwrMetadataDialog::PostLayoutDynInitL
       
   270 //-----------------------------------------------------------------------------
       
   271 //
       
   272 void CGlxImgVwrMetadataDialog::PostLayoutDynInitL()
       
   273     {}
       
   274 
       
   275 //-----------------------------------------------------------------------------
       
   276 // CGlxImgVwrMetadataDialog::Draw
       
   277 //-----------------------------------------------------------------------------
       
   278 //
       
   279 void CGlxImgVwrMetadataDialog::Draw( const TRect& /*aRect*/ ) const
       
   280 {
       
   281 TRACER("CGlxImgVwrMetadataDialog::Draw");
       
   282 TRect rect;
       
   283 AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
       
   284 
       
   285 // Get the standard graphics context
       
   286 CWindowGc& gc = SystemGc();
       
   287 gc.SetBrushColor(KRgbWhite);
       
   288 gc.DrawRect(rect);
       
   289 }
       
   290 
       
   291 //-----------------------------------------------------------------------------
       
   292 // CGlxImgVwrMetadataDialog::HandlePointerEventL
       
   293 //-----------------------------------------------------------------------------
       
   294 //
       
   295 void CGlxImgVwrMetadataDialog::HandlePointerEventL(
       
   296         const TPointerEvent& aPointerEvent)
       
   297     {
       
   298     TRACER("CGlxImgVwrMetadataDialog::HandlePointerEventL");
       
   299     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   300     }
       
   301 
   213 // ---------------------------------------------------------------------------
   302 // ---------------------------------------------------------------------------
   214 // CGlxImgVwrMetadataDialog::SetTitleL()
   303 // CGlxImgVwrMetadataDialog::SetTitleL()
   215 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
   216 void CGlxImgVwrMetadataDialog::SetTitleL(const TDesC& aTitleText)
   305 void CGlxImgVwrMetadataDialog::SetTitleL(const TDesC& aTitleText)
   217     {
   306     {
   218     TRACER("CGlxImgVwrMetadataDialog::SetTitleL");
   307     TRACER("CGlxFetcherContainer::SetTitleL");
   219     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   308     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   220     CleanupStack::PushL(statusPane);
   309     CleanupStack::PushL(statusPane);
   221     // get pointer to the default title pane control
   310     // get pointer to the default title pane control
   222     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   311     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   223             TUid::Uid( EEikStatusPaneUidTitle ));       
   312             TUid::Uid( EEikStatusPaneUidTitle ));       
   237 // ---------------------------------------------------------------------------
   326 // ---------------------------------------------------------------------------
   238 // CGlxImgVwrMetadataDialog::SetPreviousTitleL
   327 // CGlxImgVwrMetadataDialog::SetPreviousTitleL
   239 // ---------------------------------------------------------------------------
   328 // ---------------------------------------------------------------------------
   240 void CGlxImgVwrMetadataDialog::SetPreviousTitleL()
   329 void CGlxImgVwrMetadataDialog::SetPreviousTitleL()
   241     {
   330     {
   242     TRACER("CGlxImgVwrMetadataDialog::SetPreviousTitleL");
   331     TRACER("CGlxFetcherContainer::SetPreviousTitleL");
   243     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   332     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   244     CleanupStack::PushL(prevStatusPane);
   333     CleanupStack::PushL(prevStatusPane);
   245     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   334     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   246             TUid::Uid( EEikStatusPaneUidTitle ));       
   335             TUid::Uid( EEikStatusPaneUidTitle ));       
   247     CleanupStack::PushL(prevTitlePane);
   336     CleanupStack::PushL(prevTitlePane);
   251         prevTitlePane->SetTextL( *iPreviousTitle );
   340         prevTitlePane->SetTextL( *iPreviousTitle );
   252         }
   341         }
   253     CleanupStack::Pop(prevTitlePane);
   342     CleanupStack::Pop(prevTitlePane);
   254     CleanupStack::Pop(prevStatusPane);
   343     CleanupStack::Pop(prevStatusPane);
   255     }
   344     }
   256 
   345 // -----------------------------------------------------------------------------
       
   346 // CGlxImgVwrMetadataDialog::HandleResourceChange
       
   347 // -----------------------------------------------------------------------------
       
   348 //
       
   349 void CGlxImgVwrMetadataDialog::HandleResourceChange( TInt aType )
       
   350     {
       
   351     TRACER("CGlxImgVwrMetadataDialog::HandleResourceChange");
       
   352     //Handle global resource changes, such as scalable UI or skin events and orientation change (override)
       
   353     CAknDialog::HandleResourceChange( aType );
       
   354     }
   257 // -----------------------------------------------------------------------------
   355 // -----------------------------------------------------------------------------
   258 // CGlxImgVwrMetadataDialog::HandleToolbarResetting
   356 // CGlxImgVwrMetadataDialog::HandleToolbarResetting
   259 // -----------------------------------------------------------------------------
   357 // -----------------------------------------------------------------------------
   260 //
   358 //
   261 void CGlxImgVwrMetadataDialog::HandleToolbarResetting(TBool aVisible)
   359 void CGlxImgVwrMetadataDialog::HandleToolbarResetting(TBool aVisible)