javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtclipboard.h
branchRCL_3
changeset 14 04becd199f91
child 17 0fd27995241b
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 SWTCLIPBOARD_H
       
    14 #define SWTCLIPBOARD_H
       
    15 
       
    16 
       
    17 #include <e32base.h>
       
    18 #include "eswtwidgetsexpanded.h"
       
    19 
       
    20 
       
    21 class CClipboard;
       
    22 
       
    23 
       
    24 const TUid KSwtWidgetsExpandedUid = {0x101FD68A};
       
    25 
       
    26 
       
    27 /**
       
    28  * CSwtClipboard
       
    29  * @lib eswt
       
    30  */
       
    31 NONSHARABLE_CLASS(CSwtClipboard)
       
    32         : public CBase
       
    33         , public MSwtClipboard
       
    34 {
       
    35 public:
       
    36     /**
       
    37      * The 1st and 2nd phase constructor wrapper
       
    38      * @param aPeer The peer to its java counterpart
       
    39      * @return CSwtClipboard*  A pointer to the  created CSwtBroser object
       
    40      */
       
    41     static CSwtClipboard* NewL(TSwtPeer aPeer);
       
    42 
       
    43     /**
       
    44      * Descontructor.
       
    45      */
       
    46     virtual ~CSwtClipboard();
       
    47 
       
    48 // From MSwtClipboard
       
    49     TSwtPeer Dispose();
       
    50     void     ClearL();
       
    51     void     GetAvailableTypesL(RArray<TInt>& aTypes) const;
       
    52     HBufC8*  GetByteContentsL(TInt aDataId) const;
       
    53     HBufC*   GetTextContentsL() const;
       
    54     void     SetByteContentL(const TDesC8& aPtr, TInt aJavaType);
       
    55     void     SetTextContentL(const TDesC& aPtr);
       
    56     TAny*    GetContentsL(TInt aTypeId) const;
       
    57 
       
    58 private:
       
    59     /**
       
    60     * Contructor.
       
    61     * @param aPeer The peer to its java counterpart
       
    62     */
       
    63     CSwtClipboard(TSwtPeer aPeer);
       
    64 
       
    65     /**
       
    66     * Second phase constructor
       
    67     */
       
    68     void ConstructL();
       
    69 
       
    70     /**
       
    71      * Convert java data type to the corresponding Symbian TUid
       
    72      * @since S60 v3.0
       
    73      * @param aJavaType Java type
       
    74      * @return Symbian TUid
       
    75      */
       
    76     TUid ConvertJavaToNativeType(TInt aJavaType) const;
       
    77 
       
    78 private: // Data
       
    79     /**
       
    80     * The java peer object
       
    81     */
       
    82     const TSwtPeer iPeer;
       
    83     
       
    84     CEikonEnv* iCoeEnv;
       
    85 };
       
    86 
       
    87 
       
    88 #endif // SWTCLIPBOARD_H