/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "nsISimpleEnumerator.idl"
#include "nsIObserver.idl"
#include "imIStatusInfo.idl"

interface ibIPossibleConversation;
interface imIAccount;
interface imIContact;

[scriptable, uuid(1b495592-8512-4443-bcdb-49118f045e42)]
interface ibIConvStatsService: nsISupports {
  // Returns an enumerator of PossibleConversations which match the given filter string.
  nsISimpleEnumerator getFilteredConvs(in AUTF8String aFilterStr);
  // A stats-service-updated notification is fired when data has been updated.
  void addObserver(in nsIObserver aObserver);
  void removeObserver(in nsIObserver aObserver);
};

[scriptable, uuid(e7e5e7ba-203c-47ea-8174-55b5e5d8131f)]
// Inherits from imIStatusInfo to avoid code duplication.
interface ibIPossibleConversation: imIStatusInfo {
  /* The source of the possible conversation. Possible values are:
   * "contact"  - From an imIContact.
   * "existing" - From an imIConversation.
   */
  readonly attribute AUTF8String source;
  readonly attribute imIAccount account;
  // If the possible conversation is a chat, statusText will give its topic.
  readonly attribute boolean isChat;
  /* Provides additional info about the conversation depending on the source:
   * "contact"  - The contact's tags (comma separated).
   * "existing" - Localized string existingConv.infoText (newtab.properties).
   */
  readonly attribute AUTF8String infoText;
};
