summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.h
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-16 03:14:48 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-16 03:14:48 +0200
commit72e0446fbc7017e7703102f733568a4f2e3c5195 (patch)
tree597f9ae450fc7e751688d1b060cd558b59aa2884 /src/urlbar/listitem.h
parentMerge commit 'refs/merge-requests/77' of git://gitorious.org/rekonq/mainline ... (diff)
downloadrekonq-72e0446fbc7017e7703102f733568a4f2e3c5195.tar.xz
Fixing Lionel's merge request:
- clean/fix APIs - removed no more used methods/signals from CompletionWidget - use item->url() (as it has been defined) - Change the "pointing out text" from underline to bold (better, IMO) - QString --> Q/K url, as needed - Restore UrlFromUserInput engine: why it has been deleted? - Comment out the isHttp() check. That way I cannot in any way connect to localhost or to my home server. Apart from typing their IPs.. - Partially fixed the switch search engine implementation. Btw, I have to say I really don't like rekonq switch my default engine just because one time I decided to give a try to another... Not sure about. - Something more coming.. But tomorrow! Now it's 3:20 am here. Good night!
Diffstat (limited to 'src/urlbar/listitem.h')
-rw-r--r--src/urlbar/listitem.h142
1 files changed, 81 insertions, 61 deletions
diff --git a/src/urlbar/listitem.h b/src/urlbar/listitem.h
index 6a6c433f..e355160a 100644
--- a/src/urlbar/listitem.h
+++ b/src/urlbar/listitem.h
@@ -23,17 +23,19 @@
*
* ============================================================ */
+
#ifndef LISTITEM_H
#define LISTITEM_H
+
+// Local Includes
+#include "urlresolver.h"
+
// KDE Includes
#include <KToolBar>
#include <KAction>
#include <KService>
-// Local Includes
-#include "urlresolver.h"
-
// Qt Includes
#include <QWidget>
#include <QLayout>
@@ -77,128 +79,146 @@ protected:
};
+// -------------------------------------------------------------------------
+
+
class TypeIcon : public QLabel
{
Q_OBJECT
- public:
- TypeIcon(int type, QWidget *parent = 0);
- private:
- QLabel *getIcon(QString icon);
+public:
+ TypeIcon(int type, QWidget *parent = 0);
+
+private:
+ QLabel *getIcon(QString icon);
};
+// -------------------------------------------------------------------------
+
+
class ItemIcon : public QLabel
{
Q_OBJECT
- public:
- ItemIcon(QString icon, QWidget *parent = 0);
+public:
+ ItemIcon(const QString &icon, QWidget *parent = 0);
};
+// -------------------------------------------------------------------------
+
+
class ItemText : public QLabel
{
Q_OBJECT
- public:
- ItemText(QString text, QString underlined, QWidget *parent = 0);
- QString underlineText(QString text, QString textToUnderline);
+public:
+ ItemText(const QString &text, const QString &textToPointOut, QWidget *parent = 0);
};
-//-------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+
class EngineBar : public KToolBar
{
Q_OBJECT
- public:
- EngineBar(QString text, QString selectedEngine, QWidget *parent = 0);
- static QString defaultEngine();
- void selectNextEngine();
-
- signals:
- void searchEngineChanged(QString url, QString engine);
-
- private slots:
- void changeSearchEngine();
+public:
+ EngineBar(const QString &text, const QString &selectedEngine, QWidget *parent = 0);
+ static QString defaultEngine();
+ void selectNextEngine();
+ KUrl url() { return m_url; };
- private:
- KAction *newEngineAction(KService::Ptr service, QString selectedEngine, QString text);
+signals:
+ void searchEngineChanged(QString url, QString engine);
+
+private slots:
+ void changeSearchEngine();
+
+private:
+ KAction *newEngineAction(KService::Ptr service, QString selectedEngine);
- QActionGroup *m_engineGroup;
+ QActionGroup *m_engineGroup;
+ KUrl m_url;
};
+// -------------------------------------------------------------------------
+
+
class SearchListItem : public ListItem
{
Q_OBJECT
- public:
- SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
-
- public slots:
- virtual void nextItemSubChoice();
-
- protected:
-
-
- private slots:
- void changeSearchEngine(QString url, QString engine);
-
- private:
- QString searchItemTitle(QString engine, QString text);
- ItemText* m_titleLabel;
- ItemIcon* m_iconLabel;
- EngineBar* m_engineBar;
- QString m_text;
- static QString m_currentEngine;
+public:
+ SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
+
+public slots:
+ virtual void nextItemSubChoice();
+
+private slots:
+ void changeSearchEngine(QString url, QString engine);
+
+private:
+ QString searchItemTitle(QString engine, QString text);
+ ItemText* m_titleLabel;
+ ItemIcon* m_iconLabel;
+ EngineBar* m_engineBar;
+ QString m_text;
+
+ static QString m_currentEngine;
};
-//-------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+
class PreviewListItem : public ListItem
{
Q_OBJECT
- public:
- PreviewListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
+public:
+ PreviewListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
};
+// -------------------------------------------------------------------------
+
+
class ItemPreview : public QLabel
{
Q_OBJECT
- public:
- ItemPreview(QString url,int width, int height, QWidget *parent = 0);
+public:
+ ItemPreview(const QString &url, int width, int height, QWidget *parent = 0);
- private:
- static QString guessNameFromUrl(QUrl url);
+private:
+ static QString guessNameFromUrl(QUrl url);
};
-//-------------------------------------------------------------------------------------------------
+
+// -------------------------------------------------------------------------
+
class BrowseListItem : public ListItem
{
Q_OBJECT
- public:
- BrowseListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
- protected:
-
+public:
+ BrowseListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
};
+
//-------------------------------------------------------------------------------------------------
+
class ListItemFactory
{
- public:
- static ListItem *create(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
-
+public:
+ static ListItem *create(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
};
-#endif \ No newline at end of file
+#endif