michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "SmsSegmentInfo.h" michael@0: #include "nsIDOMClassInfo.h" michael@0: michael@0: using namespace mozilla::dom::mobilemessage; michael@0: michael@0: DOMCI_DATA(MozSmsSegmentInfo, mozilla::dom::SmsSegmentInfo) michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: NS_INTERFACE_MAP_BEGIN(SmsSegmentInfo) michael@0: NS_INTERFACE_MAP_ENTRY(nsIDOMMozSmsSegmentInfo) michael@0: NS_INTERFACE_MAP_ENTRY(nsISupports) michael@0: NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozSmsSegmentInfo) michael@0: NS_INTERFACE_MAP_END michael@0: michael@0: NS_IMPL_ADDREF(SmsSegmentInfo) michael@0: NS_IMPL_RELEASE(SmsSegmentInfo) michael@0: michael@0: SmsSegmentInfo::SmsSegmentInfo(int32_t aSegments, michael@0: int32_t aCharsPerSegment, michael@0: int32_t aCharsAvailableInLastSegment) michael@0: : mData(aSegments, aCharsPerSegment, aCharsAvailableInLastSegment) michael@0: { michael@0: } michael@0: michael@0: SmsSegmentInfo::SmsSegmentInfo(const SmsSegmentInfoData& aData) michael@0: : mData(aData) michael@0: { michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsSegmentInfo::GetSegments(int32_t* aSegments) michael@0: { michael@0: *aSegments = mData.segments(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsSegmentInfo::GetCharsPerSegment(int32_t* aCharsPerSegment) michael@0: { michael@0: *aCharsPerSegment = mData.charsPerSegment(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsSegmentInfo::GetCharsAvailableInLastSegment(int32_t* aCharsAvailableInLastSegment) michael@0: { michael@0: *aCharsAvailableInLastSegment = mData.charsAvailableInLastSegment(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: const SmsSegmentInfoData& michael@0: SmsSegmentInfo::GetData() const michael@0: { michael@0: return mData; michael@0: } michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla