|
From: CVS C. to T. <the...@li...> - 2011-01-16 13:45:23
|
Revision: 608
http://themis.svn.sourceforge.net/themis/?rev=608&view=rev
Author: mark_hellegers
Date: 2011-01-16 13:45:17 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
SiteEntry now derives from UrlEntry.
Modified Paths:
--------------
trunk/themis/framework/SiteEntry.cpp
trunk/themis/framework/SiteEntry.h
trunk/themis/framework/UrlEntry.h
Modified: trunk/themis/framework/SiteEntry.cpp
===================================================================
--- trunk/themis/framework/SiteEntry.cpp 2011-01-16 13:40:37 UTC (rev 607)
+++ trunk/themis/framework/SiteEntry.cpp 2011-01-16 13:45:17 UTC (rev 608)
@@ -14,36 +14,19 @@
#include "UrlEntry.h"
// Constants declared
-const string kUrl = "Url";
-const string kTitle = "Title";
const string kStatusText = "StatusText";
-const string kSecureConnection = "SecureConnection";
const string kCookiesDisabled = "CookiesDisabled";
-const string kLoadingProgress = "LoadingProgress";
const string kFavIcon = "FavIcon";
SiteEntry :: SiteEntry(int32 id,
- const char * url) : BaseEntry(id) {
+ const char * url)
+ : UrlEntry(id, url) {
- set(kLoadingProgress, -1);
- set(kUrl, url);
-
string statusText = "Transfering data from ";
statusText += url;
statusText += " ...";
set(kStatusText, statusText);
- /*
- * The page title is set to "loading..." now.
- * When loading is finished, its set to the sites url.
- * Then we got two options. Either I do grab the page title
- * from the DOM tree, when the HTML parser is finished, or
- * I wait for the renderer to finish, which then delivers me
- * the page title.
- */
- set(kTitle, "loading...");
-
- set(kSecureConnection, false);
set(kCookiesDisabled, false);
}
@@ -77,38 +60,20 @@
}
-bool SiteEntry :: GetSecureConnection() {
-
- return getBoolean(kSecureConnection);
-
-}
-
const char * SiteEntry :: GetStatusText() {
return getString(kStatusText).c_str();
}
-const char * SiteEntry :: GetTitle() {
-
- return getString(kTitle).c_str();
-
-}
-
-const char * SiteEntry :: GetUrl() {
-
- return getString(kUrl).c_str();
-
-}
-
void SiteEntry :: Print() {
printf("------------------------------------\n");
- printf("SiteEntry: ID[%ld] URL[%s] TITLE[%s]\n", getId(), getString(kUrl).c_str(), getString(kTitle).c_str());
+ printf("SiteEntry: ID[%ld] URL[%s] TITLE[%s]\n", getId(), GetUrl(), GetTitle());
printf(" LoadingProgess[%d] CookiesDisabled[%s], SecureConnection[%s]\n",
- getInteger(kLoadingProgress),
+ GetLoadingProgress(),
getBoolean(kCookiesDisabled) ? "true" : "false",
- getBoolean(kSecureConnection) ? "true" : "false");
+ GetSecureConnection() ? "true" : "false");
printf(" -- SiteEntry UrlEntries --\n");
@@ -141,22 +106,15 @@
void SiteEntry :: SetLoadingProgress(int loadingprogress) {
- set(kLoadingProgress, loadingprogress);
+ UrlEntry::SetLoadingProgress(loadingprogress);
if (loadingprogress == 100) {
set(kStatusText, "Done.");
- set(kTitle, getString(kUrl));
}
}
-void SiteEntry :: SetSecureConnection(bool value) {
-
- set(kSecureConnection, value);
-
+void SiteEntry :: SetStatusText(const char * text) {
+
+ set(kStatusText, text);
+
}
-
-void SiteEntry :: SetTitle(const char * title) {
-
- set(kTitle, title);
-
-}
Modified: trunk/themis/framework/SiteEntry.h
===================================================================
--- trunk/themis/framework/SiteEntry.h 2011-01-16 13:40:37 UTC (rev 607)
+++ trunk/themis/framework/SiteEntry.h 2011-01-16 13:45:17 UTC (rev 608)
@@ -5,20 +5,13 @@
#ifndef SITEENTRY_H
#define SITEENTRY_H
-// Standard C++ headers
-#include <vector.h>
-
// Themis headers
-#include "BaseEntry.hpp"
+#include "UrlEntry.h"
-// Namespaces used
-using namespace std;
-
// Declarations used
class BBitmap;
-class UrlEntry;
-class SiteEntry : public BaseEntry {
+class SiteEntry : public UrlEntry {
public:
SiteEntry(int32 id,
@@ -26,18 +19,13 @@
bool GetCookiesDisabled();
BBitmap * GetFavIcon();
- int GetLoadingProgress();
- bool GetSecureConnection();
+ virtual int GetLoadingProgress();
const char * GetStatusText();
- const char * GetTitle();
- const char * GetUrl();
- void Print();
+ virtual void Print();
void SetCookiesDisabled(bool value);
void SetFavIcon(BBitmap * bmp);
- void SetLoadingProgress(int loadingprogress);
- void SetSecureConnection(bool value);
+ virtual void SetLoadingProgress(int loadingprogress);
void SetStatusText(const char * text);
- void SetTitle(const char * title);
};
Modified: trunk/themis/framework/UrlEntry.h
===================================================================
--- trunk/themis/framework/UrlEntry.h 2011-01-16 13:40:37 UTC (rev 607)
+++ trunk/themis/framework/UrlEntry.h 2011-01-16 13:45:17 UTC (rev 608)
@@ -13,13 +13,13 @@
UrlEntry(int32 id,
const char * url);
- int GetLoadingProgress();
+ virtual int GetLoadingProgress();
bool GetSecureConnection();
const char * GetTitle();
const char * GetUrl();
- void Print();
- void SetLoadingProgress(int loadingprogress);
+ virtual void Print();
+ virtual void SetLoadingProgress(int loadingprogress);
void SetSecureConnection(bool value);
void SetTitle(const char * title);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|