javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtmessagebox.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - S60 implementation
       
    10  *******************************************************************************/
       
    11 
       
    12 
       
    13 #ifndef SWTMESSAGEBOX_H
       
    14 #define SWTMESSAGEBOX_H
       
    15 
       
    16 
       
    17 #include "eswt.h"
       
    18 
       
    19 
       
    20 class CSwtPopupFormProxy;
       
    21 
       
    22 
       
    23 /**
       
    24  * CSwtMessageBox
       
    25  * MessageBox peer implementation. Uses CAknPopupForm.
       
    26  * @lib eswt
       
    27  */
       
    28 NONSHARABLE_CLASS(CSwtMessageBox)
       
    29         : CBase
       
    30         , public MSwtResourceChangeObserver
       
    31 {
       
    32 // Own methods
       
    33 public:
       
    34     /**
       
    35      * Dialog executor.
       
    36      * @param aTitle title
       
    37      * @param aMessage message
       
    38      * @param aStyle dialog style
       
    39      */
       
    40     static TInt RunDlgLD(MSwtDisplay& aDisplay, const TDesC& aTitle,
       
    41     const TDesC& aMessage, TInt aStyle);
       
    42 
       
    43     /**
       
    44      * Two phase constructor.
       
    45      * @param aTitle title
       
    46      * @param aMessage message
       
    47      * @param aStyle dialog style
       
    48      */
       
    49     static CSwtMessageBox* NewLC(MSwtDisplay& aDisplay,  const TDesC& aTitle,
       
    50                                  const TDesC& aMessage, TInt aStyle);
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CSwtMessageBox();
       
    56 
       
    57 public:
       
    58     TInt RunL();
       
    59 
       
    60 // From MSwtResourceChangeObserver
       
    61     void OfferResourceChangeL(TInt aType);
       
    62 
       
    63 // Own methods
       
    64 private:
       
    65     /**
       
    66      * First phase constructor.
       
    67      * @param aTitle title
       
    68      * @param aStyle dialog style
       
    69      */
       
    70     CSwtMessageBox(MSwtDisplay& aDisplay, TInt aStyle);
       
    71 
       
    72     /**
       
    73      * Second phase constructor.
       
    74      */
       
    75     void ConstructL(const TDesC& aTitle, const TDesC& aMessage);
       
    76 
       
    77     /**
       
    78      * Button id converter.
       
    79      * @param aButtonId
       
    80      * @return TInt
       
    81      */
       
    82     TInt ConvertButtonId(TInt aButtonId) const;
       
    83 
       
    84     /**
       
    85      * Animation id getter.
       
    86      */
       
    87     TInt Animation() const;
       
    88 
       
    89     /**
       
    90      * Button id getter.
       
    91      */
       
    92     TInt Button() const;
       
    93 
       
    94 // Data
       
    95 private:
       
    96 
       
    97     /**
       
    98      * Pupup from.
       
    99      */
       
   100     CSwtPopupFormProxy* iPopupForm;
       
   101 
       
   102     /**
       
   103      * Parent display.
       
   104      */
       
   105     MSwtDisplay& iDisplay;
       
   106 
       
   107     /**
       
   108      * Dialog style.
       
   109      */
       
   110     TInt iStyle;
       
   111 
       
   112     /**
       
   113      * Dialog animation.
       
   114      */
       
   115     TInt iAnimation;
       
   116 };
       
   117 
       
   118 #endif // SWTMESSAGEBOX_H