diff -r f5050f1da672 -r 04becd199f91 javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcontrolhelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcontrolhelper.h Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nokia Corporation - S60 implementation + *******************************************************************************/ + + +#ifndef SWTCONTROLHELPER_H +#define SWTCONTROLHELPER_H + + +#include +#include +#include +#include "eswtwidgetscore.h" + + +class CCoeControl; +class CEikScrollBarFrame; +class CSwtScrollBar; +class CWindowGc; + + +/** + * SwtControlHelper + * @lib eswt + */ +NONSHARABLE_CLASS(SwtControlHelper) +{ +// Methods +public: + /** + * Copies a bitmap. + * @param aBitmap The source bitmap for copy operation. + * @param aTargetSize Optional target size if scaling is desired. + * @return Pointer to the copy. Copy is owned by the caller. + */ + static CFbsBitmap* GetCopyOfBitmapLC(const CFbsBitmap* aBitmap, + const TSize& aTargetSize = TSize(-1, -1)); + + /** + * Copies a bitmap. + * @param aBitmap The source bitmap for copy operation. + * @param aTargetSize Optional target size if scaling is desired. + * @return Pointer to the copy. Copy is owned by the caller. + */ + static CFbsBitmap* GetCopyOfBitmapL(const CFbsBitmap* aBitmap, + const TSize& aTargetSize = TSize(-1, -1)); + + /** + * Copies a bitmap inverting it in the case it's monochrome. + * @param aBitmap The source bitmap for copy operation. + * @param aTargetSize Optional target size if scaling is desired. + * @return Pointer to the copy. Copy is owned by the caller. + */ + static CFbsBitmap* GetInvertedCopyOfMonoBitmapLC(const CFbsBitmap* aBitmap, + const TSize& aTargetSize = TSize(-1, -1)); + + /** + * Copies a bitmap inverting it in the case it's monochrome. + * @param aBitmap The source bitmap for copy operation. + * @param aTargetSize Optional target size if scaling is desired. + * @return Pointer to the copy. Copy is owned by the caller. + */ + static CFbsBitmap* GetInvertedCopyOfMonoBitmapL(const CFbsBitmap* aBitmap, + const TSize& aTargetSize = TSize(-1, -1)); + + /** + * Retrieves the clipboard's text content. + * It is up to the caller to free the descriptor by calling + * CleanupStack::PopAndDestroy() if the descriptor's + * pointer is not NULL. + * @return A descriptor containing the clipboard's content. + */ + static TPtr GetClipboardTextContentLC(); + + /** + * Returns size for a bitmap that is aspect ratio scaled to fit inside + * aMaxDestSize if aSourceSize > aMaxDestSize + * @param aSourceSize The source bitmap size. + * @param aMaxDestSize Maximum size for the bitmap. + * @return Resulting size. If any scaling was needed, it is done so + * that the aspect ratio does not change. + */ + static TSize GetAspectRatioScaledBitmapSize(const TSize& aSourceSize, + const TSize& aMaxDestSize); +}; + + +#endif // SWTCONTROLHELPER_H