sl@0: // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // sl@0: // Permission is hereby granted, free of charge, to any person obtaining a sl@0: // copy of this software and/or associated documentation files (the sl@0: // "Materials"), to deal in the Materials without restriction, including sl@0: // without limitation the rights to use, copy, modify, merge, publish, sl@0: // distribute, sublicense, and/or sell copies of the Materials, and to sl@0: // permit persons to whom the Materials are furnished to do so, subject to sl@0: // the following conditions: sl@0: // sl@0: // The above copyright notice and this permission notice shall be included sl@0: // in all copies or substantial portions of the Materials. sl@0: // sl@0: // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, sl@0: // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF sl@0: // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. sl@0: // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY sl@0: // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, sl@0: // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE sl@0: // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. sl@0: // sl@0: // Description: sl@0: // Display Update Abstract Interface sl@0: // sl@0: // sl@0: sl@0: #ifndef OPENWFC_RI_DISPLAY_UPDATE_H sl@0: #define OPENWFC_RI_DISPLAY_UPDATE_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * \brief Abstract interface used by OPENWF-C SI in order to display sl@0: * the composed content sl@0: * sl@0: */ sl@0: sl@0: class MOpenWFC_RI_Display_Update sl@0: { sl@0: public: sl@0: /** sl@0: * Retrieves one of the display attributes sl@0: * sl@0: * @param aAttributeId The attribute ID to be retrieved. sl@0: * @param aAttribute Pointer to the attribute to be retrieved sl@0: * @param aAttributeSize Size in bytes of attribute to be retrieved sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt GetAttribute(TInt aAttributeId, TAny* aAttribute, TInt aAttributeSize) = 0; sl@0: sl@0: /** sl@0: * Sets one of the display attributes sl@0: * sl@0: * @param aAttributeId The attribute ID to be retrieved. sl@0: * @param aAttribute Pointer to the attribute to be retrieved sl@0: * @param aAttributeSize Size in bytes of attribute to be retrieved sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt SetAttribute(TInt aAttributeId, TAny* aAttribute, TInt aAttributeSize) = 0; sl@0: sl@0: /** sl@0: * Commits the display attribute. sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt CommitAttribute() = 0; sl@0: sl@0: /** sl@0: * Associates a stream with the topmost display layer (overlay). sl@0: * Must have been called successfully before calling UpdateDisplay. sl@0: * Also used to specify the composed output stream as the display layer. sl@0: * Note that currently this method is called each composition, sl@0: * but it is only necessary to call it when the top stream changes. sl@0: * sl@0: * This method may fail if any attributes of the stream cannot be handled by the display device. sl@0: * The aNonTrivialAttributes is a zero-terminated list of attribute keys and values sl@0: * that do not match the trivial cases for direct composition, but that some devices may support, sl@0: * representing eg mirror, scale, rotation, offset, or oversize cases. sl@0: * The implementation of this method will stop processing the list and fail if it does not recogise sl@0: * any of the keys or cannot accept the value associated with that key for direct display. sl@0: * All platforms should accept an empty or NULL list, but some may simply fail if the list is non-empty, sl@0: * so the caller should keep the list brief. sl@0: * sl@0: * If the method fails, then the caller must compose the content into a simpler format, sl@0: * and call SetTopLayerSurface again before calling UpdateDisplay. sl@0: * It is expected that there will be at least 1 pre-determined simpler format or stream handle that will always succeed. sl@0: * sl@0: * @param aStream The stream Id to be associated with the topmost layer sl@0: * @param aNonTrivialAttributes Attribute integer pair list of any non-trivial attribute values. sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt SetTopLayerSurface(SymbianStreamType aStream,TInt* aNonTrivialAttributes=NULL) = 0; sl@0: sl@0: /** sl@0: * Associates a stream with a specific layer. sl@0: * Must have been called successfully before calling UpdateDisplay. sl@0: * Note that currently this method is called each composition, sl@0: * but it is only necessary to call it when the stream stack changes, sl@0: * when all layers should be re-specified in turn before the next UpdateDisplay call. sl@0: * sl@0: * This method may fail if any attributes of the stream cannot be handled by the display device. sl@0: * The aNonTrivialAttributes is a zero-terminated list of attribute keys and values sl@0: * that do not match the trivial cases for direct composition, but that some devices may support, sl@0: * representing eg mirror, scale, rotation, offset, undersize or oversize cases, sl@0: * and could be used to represent multiple layers. sl@0: * The implementation of this method will fail if it does not recogise any of the keys sl@0: * or cannot accept the value associated with that key for direct display. sl@0: * All platforms should accept an empty or NULL list, but some may simply fail if the list is non-empty, sl@0: * so the caller should keep the list brief. sl@0: * sl@0: * If the method fails, then the caller must compose the content into a simpler format, sl@0: * and call SetTopLayerSurface (or SetLayerSurface) again before calling UpdateDisplay. sl@0: * sl@0: * @param aLayer The layer id. The layer number "0" is the topmost layer. sl@0: * @param aStream The stream Id to be associated with the specified layer, or SYMBIAN_INVALID_HANDLE. sl@0: * @param aNonTrivialAttributes Attribute integer pair list of any non-trivial attribute values. sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt SetLayerSurface(TInt aLayer, SymbianStreamType aStream,TInt* aNonTrivialAttributes=NULL) = 0; sl@0: sl@0: /** sl@0: * Update (flush/post) the screen sl@0: * sl@0: * @return KErrNone or a system wide error sl@0: */ sl@0: virtual TInt UpdateDisplay() = 0; sl@0: }; sl@0: #endif // OPENWFC_RI_DISPLAY_UPDATE_H