• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Plasma

plasma_view_host.h

Go to the documentation of this file.
00001 /*
00002   Copyright 2007 Google Inc.
00003 
00004   Licensed under the Apache License, Version 2.0 (the "License");
00005   you may not use this file except in compliance with the License.
00006   You may obtain a copy of the License at
00007 
00008        http://www.apache.org/licenses/LICENSE-2.0
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 */
00016 
00017 #ifndef GGADGET_PLASMA_VIEW_HOST_H__
00018 #define GGADGET_PLASMA_VIEW_HOST_H__
00019 
00020 #include <set>
00021 
00022 #include <QtGui/QGraphicsWidget>
00023 
00024 #include <ggadget/view_interface.h>
00025 #include <ggadget/graphics_interface.h>
00026 #include <ggadget/view_host_interface.h>
00027 #include <ggadget/qt/qt_graphics.h>
00028 #include <ggadget/qt/qt_view_widget.h>
00029 #include "plasma_host.h"
00030 
00031 namespace ggadget {
00032 
00033 using namespace ggadget::qt;
00034 
00035 inline bool isHorizontal(Plasma::Location loc) {
00036   return loc == Plasma::TopEdge || loc == Plasma::BottomEdge;
00037 }
00038 
00039 inline bool isVertical(Plasma::Location loc) {
00040   return loc == Plasma::LeftEdge || loc == Plasma::RightEdge;
00041 }
00042 
00043 
00044 class PlasmaViewHost : public ViewHostInterface {
00045  public:
00046   PlasmaViewHost(GadgetInfo *info, ViewHostInterface::Type type, bool popout = false);
00047   virtual ~PlasmaViewHost();
00048 
00049   virtual Type GetType() const;
00050   virtual void Destroy();
00051   virtual void SetView(ViewInterface *view);
00052   virtual ViewInterface *GetView() const;
00053   virtual GraphicsInterface *NewGraphics() const {
00054     return new QtGraphics(1.0);
00055   }
00056   virtual void *GetNativeWidget() const;
00057   virtual void ViewCoordToNativeWidgetCoord(
00058       double x, double y, double *widget_x, double *widget_y) const;
00059   virtual void NativeWidgetCoordToViewCoord(
00060       double x, double y, double *view_x, double *view_y) const;
00061   virtual void QueueDraw();
00062   virtual void QueueResize();
00063   virtual void EnableInputShapeMask(bool enable);
00064   virtual void SetResizable(ViewInterface::ResizableMode mode);
00065   virtual void SetCaption(const std::string &caption);
00066   virtual void SetShowCaptionAlways(bool always);
00067   virtual void SetCursor(ggadget::ViewInterface::CursorType cursor);
00068   virtual void ShowTooltip(const std::string &tooltip);
00069   virtual void ShowTooltipAtPosition(const std::string &tooltip,
00070                                      double x, double y);
00071   virtual bool ShowView(bool modal, int flags,
00072                         Slot1<bool, int> *feedback_handler);
00073   virtual void CloseView();
00074   virtual bool ShowContextMenu(int button);
00075   virtual void BeginResizeDrag(int, ViewInterface::HitTest) {}
00076   virtual void BeginMoveDrag(int) {}
00077 
00078   virtual void Alert(const ViewInterface *view, const char *message);
00079   virtual ggadget::ViewHostInterface::ConfirmResponse Confirm(const ViewInterface *view, const char *message, bool);
00080   virtual std::string Prompt(const ViewInterface *view,
00081                              const char *message,
00082                              const char *default_value);
00083   virtual int GetDebugMode() const;
00084 
00085   GadgetInfo *getInfo();
00086 
00087  private:
00088   class Private;
00089   Private *d;
00090   DISALLOW_EVIL_CONSTRUCTORS(PlasmaViewHost);
00091 };
00092 
00093 } // namespace ggadget
00094 
00095 #endif // GGADGET_PLASMA_VIEW_HOST_H__

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal