1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Original Code is mozilla.org code.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 2001
19 * the Initial Developer. All Rights Reserved.
22 * Joe Hewitt <hewitt@netscape.com> (Original Author)
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include
"nsISupports.idl"
40 interface mozIStorageConnection
;
43 * The nsIFormHistory object is a service which holds a set of name/value
44 * pairs. The names correspond to form field names, and the values correspond
45 * to values the user has submitted. So, several values may exist for a single
48 * Note: this interface provides no means to access stored values.
49 * Stored values are used by the FormFillController to generate
50 * autocomplete matches.
53 [scriptable
, uuid(5d7d84d1
-9798-4016-bf61
-a32acf09b29d
)]
54 interface nsIFormHistory2
: nsISupports
57 * Returns true if the form history has any entries.
59 readonly attribute
boolean hasEntries
;
62 * Adds a name and value pair to the form history.
64 void addEntry
(in AString name
, in AString value
);
67 * Removes a name and value pair from the form history.
69 void removeEntry
(in AString name
, in AString value
);
72 * Removes all entries that are paired with a name.
74 void removeEntriesForName
(in AString name
);
77 * Removes all entries in the entire form history.
79 void removeAllEntries
();
82 * Returns true if there is no entry that is paired with a name.
84 boolean nameExists
(in AString name
);
87 * Gets whether a name and value pair exists in the form history.
89 boolean entryExists
(in AString name
, in AString value
);
92 * Removes entries that were created between the specified times.
95 * The beginning of the timeframe, in microseconds
97 * The end of the timeframe, in microseconds
99 void removeEntriesByTimeframe
(in long long aBeginTime
, in long long aEndTime
);
102 * Returns the underlying DB connection the form history module is using.
104 readonly attribute mozIStorageConnection DBConnection
;
108 * nsIFormHistoryImporter is an interface for importing a Mork formhistory.dat
109 * file into the new form history storage.
112 [scriptable
, uuid(9e811188
-6a5b
-4d96
-a92d
-1bac66a41898
)]
113 interface nsIFormHistoryImporter
: nsISupports
116 * Import the given Mork form history file.
117 * @param file The Mork form history file to import
118 * @param history A reference to the nsIFormHistory. This is
119 * supplied since the importer is invoked during
120 * form history initialization.
122 void importFormHistory
(in nsIFile file
, in nsIFormHistory2 formHistory
);