Home | History | Annotate | Download | only in qt
      1 /*
      2     Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
      3 
      4     This library is free software; you can redistribute it and/or
      5     modify it under the terms of the GNU Library General Public
      6     License as published by the Free Software Foundation; either
      7     version 2 of the License, or (at your option) any later version.
      8 
      9     This library is distributed in the hope that it will be useful,
     10     but WITHOUT ANY WARRANTY; without even the implied warranty of
     11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12     Library General Public License for more details.
     13 
     14     You should have received a copy of the GNU Library General Public License
     15     along with this library; see the file COPYING.LIB.  If not, write to
     16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17     Boston, MA 02110-1301, USA.
     18 */
     19 
     20 #ifndef GraphicsLayerQt_h
     21 #define GraphicsLayerQt_h
     22 
     23 #include "GraphicsLayer.h"
     24 #include "GraphicsLayerClient.h"
     25 
     26 #if !defined(QT_NO_GRAPHICSVIEW)
     27 
     28 namespace WebCore {
     29 
     30 class GraphicsLayerQtImpl;
     31 
     32 class GraphicsLayerQt : public GraphicsLayer {
     33     friend class GraphicsLayerQtImpl;
     34 
     35 public:
     36     GraphicsLayerQt(GraphicsLayerClient*);
     37     virtual ~GraphicsLayerQt();
     38 
     39     // reimps from GraphicsLayer.h
     40     virtual PlatformLayer* platformLayer() const;
     41     virtual void setNeedsDisplay();
     42     virtual void setNeedsDisplayInRect(const FloatRect&);
     43     virtual void setParent(GraphicsLayer* layer);
     44     virtual void setName(const String& name);
     45     virtual bool setChildren(const Vector<GraphicsLayer*>&);
     46     virtual void addChild(GraphicsLayer*);
     47     virtual void addChildAtIndex(GraphicsLayer*, int index);
     48     virtual void addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling);
     49     virtual void addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling);
     50     virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
     51     virtual void removeFromParent();
     52     virtual void setMaskLayer(GraphicsLayer* layer);
     53     virtual void setPosition(const FloatPoint& p);
     54     virtual void setAnchorPoint(const FloatPoint3D& p);
     55     virtual void setSize(const FloatSize& size);
     56     virtual void setTransform(const TransformationMatrix& t);
     57     virtual void setChildrenTransform(const TransformationMatrix& t);
     58     virtual void setPreserves3D(bool b);
     59     virtual void setMasksToBounds(bool b);
     60     virtual void setDrawsContent(bool b);
     61     virtual void setBackgroundColor(const Color&);
     62     virtual void clearBackgroundColor();
     63     virtual void setContentsOpaque(bool b);
     64     virtual void setBackfaceVisibility(bool b);
     65     virtual void setOpacity(float opacity);
     66     virtual void setContentsRect(const IntRect& r);
     67 #ifndef QT_NO_ANIMATION
     68     virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& keyframesName, double timeOffset);
     69     virtual void removeAnimationsForProperty(AnimatedPropertyID);
     70     virtual void removeAnimationsForKeyframes(const String& keyframesName);
     71     virtual void pauseAnimation(const String& keyframesName, double timeOffset);
     72     virtual void suspendAnimations(double time);
     73     virtual void resumeAnimations();
     74 #endif // QT_NO_ANIMATION
     75     virtual void setContentsToImage(Image*);
     76     virtual void setContentsNeedsDisplay();
     77     virtual void setContentsToMedia(PlatformLayer*);
     78     virtual void setContentsToCanvas(PlatformLayer*);
     79     virtual void setContentsBackgroundColor(const Color&);
     80     virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation);
     81     virtual void distributeOpacity(float);
     82     virtual float accumulatedOpacity() const;
     83     virtual void syncCompositingState();
     84     virtual void syncCompositingStateForThisLayerOnly();
     85 
     86 private:
     87     OwnPtr<GraphicsLayerQtImpl> m_impl;
     88 };
     89 
     90 }
     91 #endif
     92 #endif // GraphicsLayerQt_h
     93