toolkit/components/satchel/nsIFormHistory.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/satchel/nsIFormHistory.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +interface nsIFile;
    1.10 +interface mozIStorageConnection;
    1.11 +
    1.12 +/**
    1.13 + * The nsIFormHistory object is a service which holds a set of name/value
    1.14 + * pairs.  The names correspond to form field names, and the values correspond
    1.15 + * to values the user has submitted.  So, several values may exist for a single
    1.16 + * name.
    1.17 + *
    1.18 + * Note: this interface provides no means to access stored values.
    1.19 + * Stored values are used by the FormFillController to generate
    1.20 + * autocomplete matches.
    1.21 + *
    1.22 + * @deprecated use FormHistory.jsm instead.
    1.23 + */
    1.24 +
    1.25 +[scriptable, uuid(5d7d84d1-9798-4016-bf61-a32acf09b29d)]
    1.26 +interface nsIFormHistory2 : nsISupports
    1.27 +{
    1.28 +  /**
    1.29 +   * Returns true if the form history has any entries.
    1.30 +   */
    1.31 +  readonly attribute boolean hasEntries;
    1.32 +
    1.33 +  /**
    1.34 +   * Adds a name and value pair to the form history.
    1.35 +   */
    1.36 +  void addEntry(in AString name, in AString value);
    1.37 +
    1.38 +  /**
    1.39 +   * Removes a name and value pair from the form history.
    1.40 +   */
    1.41 +  void removeEntry(in AString name, in AString value);
    1.42 +
    1.43 +  /**
    1.44 +   * Removes all entries that are paired with a name.
    1.45 +   */
    1.46 +  void removeEntriesForName(in AString name);
    1.47 +
    1.48 +  /**
    1.49 +   * Removes all entries in the entire form history.
    1.50 +   */
    1.51 +  void removeAllEntries();
    1.52 +
    1.53 +  /**
    1.54 +   * Returns true if there is no entry that is paired with a name.
    1.55 +   */
    1.56 +  boolean nameExists(in AString name);
    1.57 +
    1.58 +  /**
    1.59 +   * Gets whether a name and value pair exists in the form history.
    1.60 +   */
    1.61 +  boolean entryExists(in AString name, in AString value);
    1.62 +
    1.63 +  /**
    1.64 +   * Removes entries that were created between the specified times.
    1.65 +   *
    1.66 +   * @param aBeginTime
    1.67 +   *        The beginning of the timeframe, in microseconds
    1.68 +   * @param aEndTime
    1.69 +   *        The end of the timeframe, in microseconds
    1.70 +   */
    1.71 +  void removeEntriesByTimeframe(in long long aBeginTime, in long long aEndTime);
    1.72 +
    1.73 +  /**
    1.74 +   * Returns the underlying DB connection the form history module is using.
    1.75 +   */
    1.76 +  readonly attribute mozIStorageConnection DBConnection;
    1.77 +};

mercurial