javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcontrolhelper.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 SWTCONTROLHELPER_H
       
    14 #define SWTCONTROLHELPER_H
       
    15 
       
    16 
       
    17 #include <coedef.h>
       
    18 #include <eiksbobs.h>
       
    19 #include <w32std.h>
       
    20 #include "eswtwidgetscore.h"
       
    21 
       
    22 
       
    23 class CCoeControl;
       
    24 class CEikScrollBarFrame;
       
    25 class CSwtScrollBar;
       
    26 class CWindowGc;
       
    27 
       
    28 
       
    29 /**
       
    30  * SwtControlHelper
       
    31  * @lib eswt
       
    32  */
       
    33 NONSHARABLE_CLASS(SwtControlHelper)
       
    34 {
       
    35 // Methods
       
    36 public:
       
    37     /**
       
    38      * Copies a bitmap.
       
    39      * @param aBitmap The source bitmap for copy operation.
       
    40      * @param aTargetSize Optional target size if scaling is desired.
       
    41      * @return Pointer to the copy. Copy is owned by the caller.
       
    42      */
       
    43     static CFbsBitmap* GetCopyOfBitmapLC(const CFbsBitmap* aBitmap,
       
    44                                          const TSize& aTargetSize = TSize(-1, -1));
       
    45 
       
    46     /**
       
    47      * Copies a bitmap.
       
    48      * @param aBitmap The source bitmap for copy operation.
       
    49      * @param aTargetSize Optional target size if scaling is desired.
       
    50      * @return Pointer to the copy. Copy is owned by the caller.
       
    51      */
       
    52     static CFbsBitmap* GetCopyOfBitmapL(const CFbsBitmap* aBitmap,
       
    53                                         const TSize& aTargetSize = TSize(-1, -1));
       
    54 
       
    55     /**
       
    56      * Copies a bitmap inverting it in the case it's monochrome.
       
    57      * @param aBitmap The source bitmap for copy operation.
       
    58      * @param aTargetSize Optional target size if scaling is desired.
       
    59      * @return Pointer to the copy. Copy is owned by the caller.
       
    60      */
       
    61     static CFbsBitmap* GetInvertedCopyOfMonoBitmapLC(const CFbsBitmap* aBitmap,
       
    62             const TSize& aTargetSize = TSize(-1, -1));
       
    63 
       
    64     /**
       
    65      * Copies a bitmap inverting it in the case it's monochrome.
       
    66      * @param aBitmap The source bitmap for copy operation.
       
    67      * @param aTargetSize Optional target size if scaling is desired.
       
    68      * @return Pointer to the copy. Copy is owned by the caller.
       
    69      */
       
    70     static CFbsBitmap* GetInvertedCopyOfMonoBitmapL(const CFbsBitmap* aBitmap,
       
    71             const TSize& aTargetSize = TSize(-1, -1));
       
    72 
       
    73     /**
       
    74      * Retrieves the clipboard's text content.
       
    75      * It is up to the caller to free the descriptor by calling
       
    76      * CleanupStack::PopAndDestroy() if the descriptor's
       
    77      * pointer is not NULL.
       
    78      * @return A descriptor containing the clipboard's content.
       
    79      */
       
    80     static TPtr GetClipboardTextContentLC();
       
    81 
       
    82     /**
       
    83      * Returns size for a bitmap that is aspect ratio scaled to fit inside
       
    84      * aMaxDestSize if aSourceSize > aMaxDestSize
       
    85      * @param aSourceSize The source bitmap size.
       
    86      * @param aMaxDestSize Maximum size for the bitmap.
       
    87      * @return Resulting size. If any scaling was needed, it is done so
       
    88      *         that the aspect ratio does not change.
       
    89      */
       
    90     static TSize GetAspectRatioScaledBitmapSize(const TSize& aSourceSize,
       
    91             const TSize& aMaxDestSize);
       
    92 };
       
    93 
       
    94 
       
    95 #endif // SWTCONTROLHELPER_H