Logo Search packages:      
Sourcecode: kmess version File versions


                          emoticon.h  -  description
    begin                : Mon Apr 15 2002
    copyright            : (C) 2002 by Mike K. Bennett
    email                : mkb137b@hotmail.com

 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *

#ifndef EMOTICON_H
#define EMOTICON_H

#include <qobject.h>
#include <qstringlist.h>

#include "currentaccount.h"

// Forward declarations
class CurrentAccount;

 * @brief Data class for an emoticon definition.
 * This class the emoticon's representative code and the picture file.
 * File paths are updated by the EmoticonCollection class when the settings change.
 * Multiple emoticon codes can be added with the addText() method.
 * @author Mike K. Bennett
 * @ingroup Root
00040 class Emoticon : public QObject

    // The constructot
                             Emoticon( const QString &fileTitle, const QString &tooltip );
    // The destructor
    virtual                 ~Emoticon();
    // Add another text element into QStringList text_
    void                     addText( QString text );
    // Read the full file path.
    const QString&           getFilePath() const;
    // Read the file title.
    const QString&           getFileTitle() const;
    // Read property of QString  html_.
    QString                  getHtml( bool small ) const;
    // Get a pattern which will match any of the variants of the emoticon
    QString                  getPattern() const;
    // Read property of QString  text_.
    QString                  getText() const;
    // Return all possible emoticon codes.
    const QStringList &      getTextList() const;
    // Read property of QString  tooltip_.
    QString                  getTooltip() const;
    // Does the emoticon have a tooltip?
    bool                     hasTooltip() const;
    // Is the emoticon valid - ie, can we find an icon for it?
    bool                     isValid() const;
    // Set the file title.
    void                     setFileTitle(const QString &fileTitle);
    // Update the file location
    void                     updatePath();

  private: // Private attributes
    // The file title of the emoticon
    QString                  fileTitle_;
    // The actual location of the emoticon
    QString                  filePath_;
    // Does the emoticon have a tooltip?
    bool                     hasTooltip_;
    // The height of the emoticon
    int                      height_;
    // The html img tag that represents the emoticon
    QString                  html_;
    // The orignal file title, used to revert to a previous file
    QString                  originalFileTitle_;
    // The text that represents the emoticon, eg :-)
    QStringList              text_;
    // Some help text for the emoticon
    QString                  tooltip_;
    // Can the icon be found
    bool                     valid_;
    // The width of the emoticon
    int                      width_;

    void                     changedFilePath();


Generated by  Doxygen 1.6.0   Back to index