/* ***** BEGIN LICENSE BLOCK *****
 * Version: GPL 3.0
 *
 * The contents of this file are subject to the General Public License
 * 3.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * Author: Michel Verbraak (info@1st-setup.nl)
 * Website: http://www.1st-setup.nl/
 * email: info@1st-setup.nl
 *
 * This interface can be used to for updates
 *
 * ***** BEGIN LICENSE BLOCK *****/

#include "nsISupports.idl"

[scriptable, uuid(c7543f10-e2d1-44b3-ae37-9221e0d5b524)]
interface mivFunctions : nsISupports
{
  AUTF8String doEncodeFolderSpecialChars(in AUTF8String str, in AUTF8String r1);

  AUTF8String encodeFolderSpecialChars(in AUTF8String aStr);

  AUTF8String doDecodeFolderSpecialChars(in AUTF8String str, in AUTF8String r1);

  AUTF8String decodeFolderSpecialChars(in AUTF8String aStr);

  jsval	ecTZService();

  jsval	ecDefaultTimeZone();

  jsval	ecUTC();

  long convertDurationToSeconds(in AUTF8String aDuration);

  jsval	splitUriGetParams(in jsval aUri);

  jsval	getBranch(in AUTF8String aName);

  AUTF8String safeGetCharPref(in jsval aBranch, in AUTF8String aName, [optional] in AUTF8String aDefaultValue, [optional] in boolean aCreateWhenNotAvailable);

  boolean safeGetBoolPref(in jsval aBranch, in AUTF8String aName, [optional] in boolean aDefaultValue, [optional] in boolean aCreateWhenNotAvailable);

  int64_t safeGetIntPref(in jsval aBranch, in AUTF8String aName, [optional] in int64_t aDefaultValue, [optional] in boolean aCreateWhenNotAvailable);

  jsval getStringBundle(in AUTF8String bundleURL);

  AUTF8String getString(in AUTF8String aBundleName, in AUTF8String aStringName, in jsval aParams, [optional]  in AUTF8String aComponent);

  AUTF8String getUUID();

  boolean shouldLog();

  void LOG(in AUTF8String aArg);

  void writeToLogFile(in AUTF8String aString);

  void WARN(in AUTF8String aMessage);

  void ERROR(in AUTF8String aMessage);

  AUTF8String STACK([optional]in uint64_t aDepth, [optional] in uint64_t aSkip);

  AUTF8String STACKshort();

  void ASSERT(in jsval aCondition, [optional] in AUTF8String aMessage, [optional] in boolean aCritical);

  AUTF8String trim(in AUTF8String str);

  uint64_t copyPreferences(in jsval aFromPrefs, in jsval aToPrefs);

  jsval xmlToJxon([optional] in AUTF8String aXMLString) ;

  jsval urlToPath(in AUTF8String aPath);
  jsval chromeToPath(in AUTF8String aPath);

  AUTF8String splitOnCharacter(in AUTF8String aString, in uint64_t aStartPos, in jsval aSplitCharacter);
  long long findCharacter(in AUTF8String aString, in long long aStartPos, in wchar aChar);
  long long findString(in AUTF8String aString, in long long aStartPos, in AUTF8String  aNeedle);

  AUTF8String copyCalendarSettings(in AUTF8String aFromId, [optional] in AUTF8String aToId);
  void addCalendarById(in AUTF8String aId);
};
