diff --git a/plasma/glapplet.h b/plasma/glapplet.h index 329104a647..4fc79fba3e 100644 --- a/plasma/glapplet.h +++ b/plasma/glapplet.h @@ -1,86 +1,86 @@ /* * Copyright 2007 Zack Rusin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PLASMA_GLAPPLET_H #define PLASMA_GLAPPLET_H #include #include namespace Plasma { /** - * @short Plasma Applet that is fully rendererd using OpengGL + * @short Plasma Applet that is fully rendered using OpengGL * */ class PLASMA_EXPORT GLApplet : public Applet { Q_OBJECT public: /** * @arg parent the QGraphicsItem this applet is parented to * @arg servideId the name of the .desktop file containing the * information about the widget * @arg appletId a unique id used to differentiate between multiple * instances of the same Applet type */ GLApplet(QGraphicsItem *parent, const QString &serviceId, int appletId); /** * This constructor is to be used with the plugin loading systems * found in KPluginInfo and KService. The argument list is expected * to have two elements: the KService service ID for the desktop entry * and an applet ID which must be a base 10 number. * * @arg parent a QObject parent; you probably want to pass in 0 * @arg args a list of strings containing two entries: the service id * and the applet id */ GLApplet(QObject *parent, const QVariantList &args); ~GLApplet(); GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D); void deleteTexture(GLuint texture_id); /** * Reimplement this method to render using OpenGL. QPainter passed * to this method will always use OpenGL engine and rendering * using OpenGL api directly is supported. */ virtual void paintGLInterface(QPainter *painter, const QStyleOptionGraphicsItem *option); void makeCurrent(); private: virtual void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect); private: class Private; Private *const d; }; } #endif diff --git a/plasma/plasma.h b/plasma/plasma.h index d536679b43..c90498edbe 100644 --- a/plasma/plasma.h +++ b/plasma/plasma.h @@ -1,175 +1,175 @@ /* * Copyright 2005 by Aaron Seigo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PLASMA_DEFS_H #define PLASMA_DEFS_H #include #include #include /** * Namespace for everything in libplasma */ namespace Plasma { /** - * The Constriants enumeration lists the various constraints that Plasma + * The Constraint enumeration lists the various constraints that Plasma * objects have managed for them and which they may wish to react to, * for instance in Applet::constraintsUpdated */ enum Constraint { NoConstraint = 0, FormFactorConstraint = 1 /** The FormFactor for an object */, LocationConstraint = 2 /** The Location of an object */, ScreenConstraint = 4 /** Which screen an object is on */, SizeConstraint = 8 /** the size of the applet was changed */, ImmutableConstraint = 16 /** the immutability (locked) nature of the applet changed */, StartupCompletedConstraint = 32 /** application startup has completed */, AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | SizeConstraint | ImmutableConstraint }; Q_DECLARE_FLAGS(Constraints, Constraint) /** * The FormFactor enumeration describes how a Plasma::Applet should arrange * itself. The value is derived from the container managing the Applet * (e.g. in Plasma, a Corona on the desktop or on a panel). **/ enum FormFactor { Planar = 0 /**< The applet lives in a plane and has two degrees of freedom to grow. Optimize for desktop, laptop or tablet usage: a high resolution screen 1-3 feet distant from the viewer. */, MediaCenter /**< As with Planar, the applet lives in a plane but the interface should be optimized for medium-to-high resolution screens that are 5-15 feet distant from the viewer. Sometimes referred to as a "ten foot interface".*/, Horizontal /**< The applet is constrained vertically, but can expand horizontally. */, - Vertical /**< The applet is contrained horizontally, but + Vertical /**< The applet is constrained horizontally, but can expand vertically. */ }; /** * The Direction enumeration describes in which direction, relative to the * Applet (and its managing container), popup menus, expanders, balloons, * message boxes, arrows and other such visually associated widgets should * appear in. This is usually the oposite of the Location. **/ enum Direction { Down = 0 /**< Display downards */ , Up /**< Display upwards */, Left /**< Display to the left */, Right /**< Display to the right */ }; /** * The Location enumeration describes where on screen an element, such as an * Applet or its managing container, is positioned on the screen. **/ enum Location { Floating = 0 /**< Free floating. Neither geometry or z-ordering is described precisely by this value. */, Desktop /**< On the planar desktop layer, extending across the full screen from edge to edge */, FullScreen /**< Full screen */, TopEdge /**< Along the top of the screen*/, BottomEdge /**< Along the bottom of the screen*/, LeftEdge /**< Along the left side of the screen */, RightEdge /**< Along the right side of the screen */ }; /** * The position enumeration * **/ enum Position { LeftPositioned /**< Positioned left */, RightPositioned /**< Positioned right */, TopPositioned /**< Positioned top */, BottomPositioned /**< Positioned bottom */, CenterPositioned /**< Positioned in the center */ }; /** * Flip enumeration */ enum FlipDirection { NoFlip = 0 /**< Do not flip */, HorizontalFlip = 1 /**< Flip horizontally */, VerticalFlip = 2 /**< Flip vertically */ }; Q_DECLARE_FLAGS(Flip, FlipDirection) /** * Zoom levels that Plasma is aware of... **/ enum ZoomLevel { DesktopZoom = 0 /**< Normal desktop usage, plasmoids are painted normally and have full interaction */, GroupZoom /**< Plasmoids are shown as icons in visual groups; drag and drop and limited context menu interaction only */ , OverviewZoom /**< Groups become icons themselves */ }; /** * Possible timing alignments **/ enum IntervalAlignment { NoAlignment = 0, AlignToMinute, AlignToHour }; enum ItemTypes { AppletType = QGraphicsItem::UserType + 1, LineEditType = QGraphicsItem::UserType + 2 }; /** * The ComonentType enumeration refers to the various types of components, * or plugins, supported by plasma. */ enum ComponentType { AppletComponent = 1 /**< Plasma::Applet based plugins **/, DataEngineComponent = 2 /**< Plasma::DataEngine based plugins **/, RunnerComponent = 4 /**< Plasma::AbstractRunner based plugsin **/, AnimatorComponent = 8 /**< Plasma::Animator based plugins **/, ContainmentComponent = 16 /**< Plasma::Containment based plugins **/ }; Q_DECLARE_FLAGS(ComponentTypes, ComponentType) /** * @return the scaling factor (0..1) for a ZoomLevel **/ PLASMA_EXPORT qreal scalingFactor(ZoomLevel level); /** * Converts a location to a direction. Handy for figuring out which way to send a popup based on * location or to point arrows and other directional items. * * @param location the location of the container the element will appear in * @reutrn the visual direction of the element should be oriented in **/ PLASMA_EXPORT Direction locationToDirection(Location location); /** * Returns a nicely rounded rectanglular path for painting. */ PLASMA_EXPORT QPainterPath roundedRectangle(const QRectF& rect, qreal radius); } // Plasma namespace Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints) Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes) #endif // multiple inclusion guard diff --git a/plasma/searchcontext.h b/plasma/searchcontext.h index b544810227..f38faa28de 100644 --- a/plasma/searchcontext.h +++ b/plasma/searchcontext.h @@ -1,174 +1,174 @@ /* * Copyright 2006-2007 Aaron Seigo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SEARCHCONTEXT_H #define SEARCHCONTEXT_H #include #include #include class KCompletion; namespace Plasma { class SearchMatch; class AbstractRunner; /** * @short The SearchContext class provides information related to a search, * including the search term, metadata on the search term and collected * matches. */ class PLASMA_EXPORT SearchContext : public QObject { Q_OBJECT public: enum Type { UnknownType = 0, Directory, File, NetworkLocation, Executable, ShellCommand, Help }; explicit SearchContext(QObject *parent = 0); ~SearchContext(); SearchContext(QObject *parent, const SearchContext& other); /** * Sets the search term for this object and attempts to determine * the type of the search. * This clears all current matches in the process. */ void resetSearchTerm(const QString&); /** * Sets the search term for this object and attempts to determine * the type of the search. */ void setSearchTerm(const QString&); /** * @return the current search term. */ QString searchTerm() const; /** * The type of item the search term might refer to. * @see Type */ Type type() const; /** * The mimetype that the search term refers to, if discoverable. * * @return QString() if the mimetype can not be determined, otherwise - * the mimetype of the object being refered to by the search + * the mimetype of the object being referred to by the search * string. */ QString mimetype() const; /** * @return a completion object that can be used with UI elements */ KCompletion* completionObject() const; /** * Adds an item to the completion object. */ void addStringCompletion(const QString& completion); /** * Adds multiple items to the completion object. */ void addStringCompletions(const QStringList& completions); /** - * Add an action that represents a match to the current search term. - * This action is informational in nature and does not represent and actionable + * Adds an action that represents a match to the current search term. + * This action is informational in nature and does not represent an actionable * match. * * If string data is added to the action using QAction::setData(), that * string may be used in user interfaces when the item is selected. */ SearchMatch* addInformationalMatch(AbstractRunner *runner); /** - * Add an action that represents an exact match to the current search term. + * Adds an action that represents an exact match to the current search term. */ SearchMatch* addExactMatch(AbstractRunner *runner); /** - * Add an action that represents a possible match to the current search term. + * Adds an action that represents a possible match to the current search term. */ SearchMatch* addPossibleMatch(AbstractRunner *runner); /** * Appends lists of matches to the lists for exact, possible, and informational matches * @return true if matches were added, false if matches were outdated */ bool addMatches( const QString& term, const QList &exactMatches, const QList &possibleMatches, const QList &informationalMatches ); /** * Retrieves all available informational matches for the current * search term. */ QList informationalMatches() const; /** * Retrieves all available exact matches for the current * search term. */ QList exactMatches() const; /** * Retrieves all available possible matches for the current * search term. */ QList possibleMatches() const; /** * Determines type of query */ void determineType(); /** * Clears matches */ void clearMatches(); Q_SIGNALS: void matchesChanged(); private: class Private; Private * const d; }; } #endif